I am trying to install requirements on a Django project but I get this error. I've tried almost everything I saw but still no luck.
I have tried pip install -r requirements.txt, pip install psycopg2, pip install psycopg2-binary but none of them worked.
My Python version is 3.9.0 and I've also tried it with 3.8.2 but still got the same error.
Here is the stack trace:
...
1 warning generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/Users/burakakyalcin/Projects/hakko_api/venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_asis.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_binary.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_datetime.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_list.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pboolean.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pdecimal.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pfloat.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_pint.o build/temp.macosx-10.9-x86_64-3.9/psycopg/adapter_qstring.o build/temp.macosx-10.9-x86_64-3.9/psycopg/aix_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/bytes_format.o build/temp.macosx-10.9-x86_64-3.9/psycopg/column_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/conninfo_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/diagnostics_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/error_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/green.o build/temp.macosx-10.9-x86_64-3.9/psycopg/libpq_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_int.o build/temp.macosx-10.9-x86_64-3.9/psycopg/lobject_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols.o build/temp.macosx-10.9-x86_64-3.9/psycopg/microprotocols_proto.o build/temp.macosx-10.9-x86_64-3.9/psycopg/notify_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/pqpath.o build/temp.macosx-10.9-x86_64-3.9/psycopg/psycopgmodule.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_connection_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_cursor_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/replication_message_type.o build/temp.macosx-10.9-x86_64-3.9/psycopg/solaris_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/typecast.o build/temp.macosx-10.9-x86_64-3.9/psycopg/utils.o build/temp.macosx-10.9-x86_64-3.9/psycopg/win32_support.o build/temp.macosx-10.9-x86_64-3.9/psycopg/xid_type.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.9/psycopg2/_psycopg.cpython-39-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/burakakyalcin/Projects/hakko_api/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-install-tiftlw89/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/lx/1m5zgk591xj0_fyybjhw1wm00000gn/T/pip-record-ccaezx4n/install-record.txt --single-version-externally-managed --compile --install-headers /Users/burakakyalcin/Projects/hakko_api/venv/include/site/python3.9/psycopg2 Check the logs for full command output.
Related
I'm getting the below error installing:
# python3 -m pip install pyodbc
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-03fk7_w4/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gf6nxri2/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.solaris-2.11-sun4v.64bit-3.7
creating build/temp.solaris-2.11-sun4v.64bit-3.7/src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -D_REENTRANT -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -fPIC -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.7m -c src/buffer.cpp -o build/temp.solaris-2.11-sun4v.64bit-3.7/src/buffer.o -Wno-write-strings
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-03fk7_w4/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-gf6nxri2/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-03fk7_w4/pyodbc/
root#myhost:/home/myfolder#
Can you please suggest how can i get pyodbc installed on Solaris and get rid of the gcc error
After installing gcc i still get the error. See below:
# which gcc
/usr/bin/gcc
Output post gcc:
# python3 -m pip install pyodbc
Collecting pyodbc
Using cached https://files.pythonhosted.org/packages/81/0d/bb08bb16c97765244791c73e49de9fd4c24bb3ef00313aed82e5640dee5d/pyodbc-4.0.30.tar.gz
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-mem1ma1r/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xwk1gj4o/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.solaris-2.11-sun4v.64bit-3.7
creating build/temp.solaris-2.11-sun4v.64bit-3.7/src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -D_REENTRANT -m64 -O3 -mno-app-regs -ffile-prefix-map=..=. -O2 -fPIC -DPIC -O3 -fPIC -DPYODBC_VERSION=4.0.30 -I/usr/include/python3.7m -c src/buffer.cpp -o build/temp.solaris-2.11-sun4v.64bit-3.7/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:12:
src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
56 | #include <sql.h>
| ^~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command "/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-mem1ma1r/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-xwk1gj4o/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-mem1ma1r/pyodbc/
Please suggest !!
I have a python script, and keep running into an error when trying to install a package.
I'm using pip 20.2.4 and python 3.7.7, on a MacOS Pro Catalina 10.15.7.
When I run pip install -r requirements.txt, it gets the below error. Any ideas on how to fix this?
Using legacy 'setup.py install' for psycopg2, since package 'wheel' is not installed.
Installing collected packages: psycopg2, psycopg2-binary
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Users/me/IdeaProjects/up/grafana/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-record-984vc1rq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/me/IdeaProjects/up/grafana/env/include/site/python3.7/psycopg2
cwd: /private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/
Complete output (151 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/psycopg2
...
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/psycopg
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework
...
I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/pqpath.c -o build/temp.macosx-10.14-x86_64-3.7/psycopg/pqpath.o
psycopg/pqpath.c:138:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
^~~~~~~~~~~~~~~~~~~~~~
psycopg/pqpath.c:1717:11: warning: code will never be executed [-Wunreachable-code]
ret = 1;
^
psycopg/pqpath.c:1822:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(curs->conn->pgconn) : PQresultStatus(curs->pgres)));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DPSYCOPG_VERSION=2.8.6 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=130001 -DHAVE_LO64=1 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -
...
I/usr/local/opt/sqlite/include -I/Users/me/IdeaProjects/up/grafana/env/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/microprotocols_proto.c -o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols_proto.o
In file included from psycopg/microprotocols_proto.c:28:
In file included from ./psycopg/psycopg.h:38:
./psycopg/config.h:82:13: warning: unused function 'Dprintf' [-Wunused-function]
static void Dprintf(const char *fmt, ...) {}
^
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g ...
L/usr/local/opt/sqlite/lib -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/me/IdeaProjects/up/grafana/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-install-z1c97jsm/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/tv/xmlxs5hd45s0n4r0qs5jtlhnbgpkgq/T/pip-record-984vc1rq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/me/IdeaProjects/up/grafana/env/include/site/python3.7/psycopg2 Check the logs for full command output.
Trying to install pip package fastavro==0.23.4 on linux rhel 7.8 but getting error:
creating build/temp.linux-x86_64-3.6/fastavro
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c fastavro/_read.c -o build/temp.linux-x86_64-3.6/fastavro/_read.o
fastavro/_read.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-p3u2ii2c/fastavro/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-57h05ysx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-p3u2ii2c/fastavro/
I already have python3 devel packages:
yum list installed|grep -i devel|grep -i python
python-devel.x86_64 2.7.5-88.el7 #rhui-rhel-7-server-rhui-rpms
rh-python36-python-devel.x86_64 3.6.9-2.el7 #rhui-rhel-server-rhui-rhscl-7-rpms
rh-python38-python-devel.x86_64 3.8.0-15.el7 #rhui-rhel-server-rhui-rhscl-7-rpms
How can I resolve this ?
Fixed this issue by manually downloading package: "python3-devel-3.6.8-13.el7.x86_64.rpm" on my rhel machine, installing it using yum and running the pyhton3 pip install again.
when I try to pip3 install tslearn on my ElementaryOS (similar to ubuntu) machine I get this error
building 'tslearn.cycc' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/tslearn
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 -I/home/bruno/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c tslearn/cycc.c -o build/temp.linux-x86_64-3.6/tslearn/cycc.o
/usr/lib/gcc/x86_64-linux-gnu/7/cc1: error while loading shared libraries: libisl.so.19: cannot open shared object file: No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5p7o5dn8/tslearn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-tqrjth8y-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-5p7o5dn8/tslearn/
I've tried the solutions on this thread but nothing works. Any ideas? Thanks
In the end I fixed it by installing libisl, then going into the install location, locating libisl.so, and creating a symlink to point libisl.so.19 to it - by doing ln -s libisl.so libisl.so.19
I'm trying to install GDAL with python.But it failed with error.
The command I use is pip install GDAL.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o -std=c++11 -I/usr/include/gdal
extensions/gdal_wrap.cpp:3177:27: fatal error: cpl_vsi_error.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
and
----------------------------------------
Failed building wheel for GDAL
Running setup.py clean for GDAL
Failed to build GDAL
Installing collected packages: GDAL
Running setup.py install for GDAL ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_spRXy/GDAL/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-NxpUaO-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying gdal.py -> build/lib.linux-x86_64-2.7
...
creating build/temp.linux-x86_64-2.7/extensions
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python2.7 -I/usr/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-2.7/extensions/gdal_wrap.o -std=c++11 -I/usr/include/gdal
extensions/gdal_wrap.cpp:3177:27: fatal error: cpl_vsi_error.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_spRXy/GDAL/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-NxpUaO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-_spRXy/GDAL/
I've already tried sudo apt-get install build-essential, but stil the same error occurs.
Here is the answer I found that worked:
"you might have to change the gdal version to the version installed on your host. So I had to do this since I have gdal==1.11.2 on my host:"
pip install gdal==1.11.2 --global-option=build_ext --global-option="-I/usr/include/gdal/"
Where the 1.11.2 should be updated to your gdal_version, which can be found in the line # define GDAL_RELEASE_NAME of the /usr/include/gdal/gdal_version.h file (at least on my system running Kubuntu).
Link to original github page with this answer from Basaks, mentioned in the comment above by Craicerjack.