I was able to install other pip libraries instead of pycopg2 when running this command - pip install psycopg2. I am using Azure Linux VM - Ubuntu 18.04 LTS and have setup database configuration in settings.py.
Below is an issue:
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
I was able to install other pip libraries instead of pycopg2 when running this command - pip install psycopg2. I am using Azure Linux VM - Ubuntu 18.04 LTS and have setup database configuration in settings.py. Below is an issue:
(venv) azureuser@signbank:~/projects/signbank$ pip install psycopg2 Collecting psycopg2 Using cached https://files.pythonhosted.org/packages/fd/ae/98cb7a0cbb1d748ee547b058b14604bd0e9bf285a8e0cc5d148f8a8a952e/psycopg2-2.8.6.tar.gz Building wheels for collected packages: psycopg2 Running setup.py bdist_wheel for psycopg2 ... error Complete output from command /home/azureuser/venv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-wzcbc8dl/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(file );code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpnx61owb_pip-wheel- --python-tag cp36: usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: -c --help [cmd1 cmd2 ...] or: -c --help-commands or: -c cmd --help
error: invalid command 'bdist_wheel'
Failed building wheel for psycopg2 Running setup.py clean for psycopg2 Failed to build psycopg2 Installing collected packages: psycopg2 Running setup.py install for psycopg2 ... error Complete output from command /home/azureuser/venv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-wzcbc8dl/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(fi le);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-nrmq1jq2-record/install-record.txt --single-version-externally-managed --co mpile --install-headers /home/azureuser/venv/include/site/python3.6/psycopg2: running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/psycopg2 copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/init.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2 copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2 running build_ext building 'psycopg2._psycopg' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/psycopg x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.6 (dt d ec pq3 ext lo64) -DPG_VERSION_NUM=100014 -DHAVE_LO64=1 -I/home/azureuser/venv/include -I/usr/include/python3.6m -I. -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c psycopg/psy copgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
Command "/home/azureuser/venv/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-wzcbc8dl/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().repl ace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-nrmq1jq2-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/azureuser/venv/include/site/python3.6/psycopg2" failed with error code 1 in /tmp/pip-build-wzcbc8dl/psycopg2/
What could it possibly go wrong or did I miss something? I need your help.