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.
Related
I am trying to run a requirements.txt file that happens to have ReportLab as a dependency but I have not been successful. I have tried pip install reportlab but the version that is installed doesn't seem to work with the other dependencies. I have used pip install -r requirements.txt --no-cache as well as appending -vvv on that command but I still haven't been successful. Any help with this?
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION="2.3.21" -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-dict.c -o build/temp.macosx-10.14-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-dict.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION="2.3.21" -Isrc/rl_addons/renderPM -Isrc/rl_addons/renderPM/libart_lgpl -Isrc/rl_addons/renderPM/gt1 -I/usr/local/include/freetype2 -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c src/rl_addons/renderPM/gt1/gt1-namecontext.c -o build/temp.macosx-10.14-x86_64-3.8/src/rl_addons/renderPM/gt1/gt1-namecontext.o
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: error: implicitly declaring library function 'strlen' with type 'unsigned long (const char *)' [-Werror,-Wimplicit-function-declaration]
len = strlen (s);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:100:9: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: error: implicitly declaring library function 'memcpy' with type 'void *(void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
memcpy (new, s, len);
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:102:3: note: include the header <string.h> or explicitly provide a declaration for 'memcpy'
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: error: implicitly declaring library function 'strcmp' with type 'int (const char *, const char *)' [-Werror,-Wimplicit-function-declaration]
if (!strcmp (nc->table[i & mask].name, name))
^
src/rl_addons/renderPM/gt1/gt1-namecontext.c:172:10: note: include the header <string.h> or explicitly provide a declaration for 'strcmp'
3 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c0/p5ztz03d7yg8_hqxl6pfpskw0000gn/T/pip-install-xaveou5b/reportlab_a0c7466f687c456b8cf242c9beaeb10b/setup.py'"'"'; __file__='"'"'/private/var/folders/c0/p5ztz03d7yg8_hqxl6pfpskw0000gn/T/pip-install-xaveou5b/reportlab_a0c7466f687c456b8cf242c9beaeb10b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/c0/p5ztz03d7yg8_hqxl6pfpskw0000gn/T/pip-record-oqkx2tig/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/evapn/Library/Python/3.8/include/python3.8/reportlab Check the logs for full command output.
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 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.
I'm trying to use import and use mmh3 for hashing however I get errors when I try to do so.
These are the error i get:
Collecting mmh3
Using cached mmh3-2.5.1.tar.gz (9.8 kB)
Building wheels for collected packages: mmh3*emphasized text*
Building wheel for mmh3 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/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/pip-wheel-vr4gj2gj
cwd: /tmp/pip-install-6vdrtr2d/mmh3/
Complete output (9 lines):
running bdist_wheel
running build
running build_ext
building 'mmh3' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c mmh3module.cpp -o build/temp.linux-x86_64-3.6/mmh3module.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for mmh3
Running setup.py clean for mmh3
Failed to build mmh3
Installing collected packages: mmh3
Running setup.py install for mmh3 ... error
ERROR: Command errored out with exit status 1:
command: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/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-rvdzd4bs/install-record.txt --single-version-externally-managed --compile --install-headers /PYSPARK-ENV/include/site/python3.6/mmh3
cwd: /tmp/pip-install-6vdrtr2d/mmh3/
Complete output (9 lines):
running install
running build
running build_ext
building 'mmh3' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c mmh3module.cpp -o build/temp.linux-x86_64-3.6/mmh3module.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /PYSPARK-ENV/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6vdrtr2d/mmh3/setup.py'"'"'; file='"'"'/tmp/pip-install-6vdrtr2d/mmh3/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-rvdzd4bs/install-record.txt --single-version-externally-managed --compile --install-headers /PYSPARK-ENV/include/site/python3.6/mmh3 Check the logs for full command output.
Note: you may need to restart the kernel to use updated packages.
Then if I try and just import it, it will say mmh3 not found
Even though it all works on my local machine
Any help would be greatly appreciated.
I am trying to install ujson which is required dependency for the installation of RASA. The command I triggered is follows:
sudo pip3 install ujson
And got the following error message.
WARNING: The directory '/home/kamaldeep/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ujson
Downloading ujson-1.35.tar.gz (192 kB)
|████████████████████████████████| 192 kB 217 kB/s
Building wheels for collected packages: ujson
Building wheel for ujson (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/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/pip-wheel-918warx5
cwd: /tmp/pip-install-uo5b9gzb/ujson/
Complete output (14 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running bdist_wheel
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/python
creating build/temp.linux-x86_64-3.7/lib
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:0:
./python/py_defines.h:39:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for ujson
Running setup.py clean for ujson
Failed to build ujson
Installing collected packages: ujson
Running setup.py install for ujson ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/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-c2p8ewru/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/ujson
cwd: /tmp/pip-install-uo5b9gzb/ujson/
Complete output (14 lines):
Warning: 'classifiers' should be a list, got type 'filter'
running install
running build
running build_ext
building 'ujson' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/python
creating build/temp.linux-x86_64-3.7/lib
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:0:
./python/py_defines.h:39:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uo5b9gzb/ujson/setup.py'"'"'; _file__='"'"'/tmp/pip-install-uo5b9gzb/ujson/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-c2p8ewru/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7/ujson Check the logs for full command output.
enter image description here
Please let me know the resolution. Thanks in advance.
You need to install the python developer package, since your are building the module from source.
sudo aptitude install python-dev
It’s Super Easy!
sudo apt-get update
sudo apt-get install python3-ujson