I'm on Mac OSX El-Capitan version 10.11.5.
When I try to install pyopenssl via pip, it fails with fatal error: 'openssl/ssl.h' file not found. See below.
Why is this file not there? And how can I get this pip install to work?
$ pip install pyopenssl==0.13.1
Collecting pyopenssl==0.13.1
Using cached pyOpenSSL-0.13.1.tar.gz
Building wheels for collected packages: pyopenssl
Running setup.py bdist_wheel for pyopenssl ... error
Complete output from command /Users/my_user/test-env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-build-NFALPZ/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/tmpUgU3gIpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
creating build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/__init__.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/tsafe.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/version.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
creating build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/__init__.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/util.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_crypto.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_rand.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_ssl.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
running build_ext
building 'OpenSSL.crypto' extension
creating build/temp.macosx-10.11-intel-2.7
creating build/temp.macosx-10.11-intel-2.7/OpenSSL
creating build/temp.macosx-10.11-intel-2.7/OpenSSL/crypto
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c OpenSSL/crypto/crypto.c -o build/temp.macosx-10.11-intel-2.7/OpenSSL/crypto/crypto.o
In file included from OpenSSL/crypto/crypto.c:16:
In file included from OpenSSL/crypto/crypto.h:30:
OpenSSL/crypto/x509.h:17:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Failed building wheel for pyopenssl
Running setup.py clean for pyopenssl
Failed to build pyopenssl
Installing collected packages: pyopenssl
Running setup.py install for pyopenssl ... error
Complete output from command /Users/my_user/test-env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-build-NFALPZ/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-G7av9L-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/my_user/test-env/include/site/python2.7/pyopenssl:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
creating build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/__init__.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/tsafe.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
copying OpenSSL/version.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL
creating build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/__init__.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/util.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_crypto.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_rand.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
copying OpenSSL/test/test_ssl.py -> build/lib.macosx-10.11-intel-2.7/OpenSSL/test
running build_ext
building 'OpenSSL.crypto' extension
creating build/temp.macosx-10.11-intel-2.7
creating build/temp.macosx-10.11-intel-2.7/OpenSSL
creating build/temp.macosx-10.11-intel-2.7/OpenSSL/crypto
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c OpenSSL/crypto/crypto.c -o build/temp.macosx-10.11-intel-2.7/OpenSSL/crypto/crypto.o
In file included from OpenSSL/crypto/crypto.c:16:
In file included from OpenSSL/crypto/crypto.h:30:
OpenSSL/crypto/x509.h:17:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/Users/my_user/test-env/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-build-NFALPZ/pyopenssl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-G7av9L-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/my_user/test-env/include/site/python2.7/pyopenssl" failed with error code 1 in /private/var/folders/q7/zl0gz8xj7ps8wswmxkqsf9khwzyc1z/T/pip-build-NFALPZ/pyopenssl/
Related
Getting below error while installing pywinpty
Collecting
https://files.pythonhosted.org/packages/b0/2c/11676105f51a7718316cd74186630f4a4cb0efa3530ebf3cfbe0b72e35cb/pywinpty-1.0.1.tar.gz
Using cached
https://files.pythonhosted.org/packages/b0/2c/11676105f51a7718316cd74186630f4a4cb0efa3530ebf3cfbe0b72e35cb/pywinpty-1.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
IOError: [Errno 2] No such file or directory: '/tmp/pip-ScCf1b-build/setup.py'
---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-ScCf1b-build/
Now i am getting below error while installing using the command pip install pywinpty==0.5.7
Collecting pywinpty==0.5.7
Using cached https://files.pythonhosted.org/packages/5d/97/8e43c2152a638cdb83d45644eb125c752abe67249f94bb3e3e29b0709685/pywinpty-0.5.7.tar.gz
Requirement already satisfied: backports.shutil_which; python_version < "3.0" in /opt/virtualenvs/certerminal/lib/python2.7/site-packages (from pywinpty==0.5.7)
Building wheels for collected packages: pywinpty
Running setup.py bdist_wheel for pywinpty ... error
Complete output from command /opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/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/tmpYI7Uslpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/winpty
copying winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty
copying winpty/ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty
copying winpty/winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty
creating build/lib.linux-x86_64-2.7/winpty/_winpty
copying winpty/_winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty/_winpty
creating build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/__init__.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_cywinpty.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty/tests
running build_ext
building 'winpty.cywinpty' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/winpty
gcc -pthread -fno-strict-aliasing -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 -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/python2.7 -c winpty/cywinpty.c -o build/temp.linux-x86_64-2.7/winpty/cywinpty.o
winpty/cywinpty.c:628:21: fatal error: Windows.h: No such file or directory
#include "Windows.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pywinpty
Running setup.py clean for pywinpty
Failed to build pywinpty
Installing collected packages: pywinpty
Running setup.py install for pywinpty ... error
Complete output from command /opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/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-n18o4q-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/virtualenvs/certerminal/include/site/python2.7/pywinpty:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/winpty
copying winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty
copying winpty/ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty
copying winpty/winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty
creating build/lib.linux-x86_64-2.7/winpty/_winpty
copying winpty/_winpty/__init__.py -> build/lib.linux-x86_64-2.7/winpty/_winpty
creating build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/__init__.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_cywinpty.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_ptyprocess.py -> build/lib.linux-x86_64-2.7/winpty/tests
copying winpty/tests/test_winpty_wrapper.py -> build/lib.linux-x86_64-2.7/winpty/tests
running build_ext
building 'winpty.cywinpty' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/winpty
gcc -pthread -fno-strict-aliasing -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 -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/python2.7 -c winpty/cywinpty.c -o build/temp.linux-x86_64-2.7/winpty/cywinpty.o
winpty/cywinpty.c:628:21: fatal error: Windows.h: No such file or directory
#include "Windows.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/opt/virtualenvs/certerminal/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-CI2oGR/pywinpty/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-n18o4q-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/virtualenvs/certerminal/include/site/python2.7/pywinpty" failed with error code 1 in /tmp/pip-build-CI2oGR/pywinpty/
I am trying to install an Apache Airflow based Machine Learning framework in a Python Virtual Environment in Mac OS. This ML framework is based on Apache Airflow version 1.9. I have configured a Python 3.6 virtual environment for this purpose. However, the ML framework installation and setup are failing due to the following error. Has anyone of you faced similar errors in Apache Airflow setup or Python 3.6 based virtual environments?
Running setup.py install for psutil ... error
ERROR: Command errored out with exit status 1:
command: /Users/gokulalex/airflow/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-install-ye9ohe71/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-install-ye9ohe71/psutil/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/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-record-anu_rweq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gokulalex/airflow/bin/../include/site/python3.6/psutil
cwd: /private/var/folders/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-install-ye9ohe71/psutil/
Complete output (45 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pswindows.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_common.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psosx.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psbsd.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pslinux.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_compat.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psposix.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pssunos.py -> build/lib.macosx-10.6-intel-3.6/psutil
creating build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/runner.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
running build_ext
building 'psutil._psutil_osx' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/psutil
creating build/temp.macosx-10.6-intel-3.6/psutil/arch
creating build/temp.macosx-10.6-intel-3.6/psutil/arch/osx
/usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=442 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_osx.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_osx.o
/usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=442 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_common.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_common.o
/usr/local/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=442 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/arch/osx/process_info.c -o build/temp.macosx-10.6-intel-3.6/psutil/arch/osx/process_info.o
/usr/local/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/psutil/_psutil_osx.o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_common.o build/temp.macosx-10.6-intel-3.6/psutil/arch/osx/process_info.o -o build/lib.macosx-10.6-intel-3.6/psutil/_psutil_osx.cpython-36m-darwin.so -framework CoreFoundation -framework IOKit
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/Cellar/llvm#4/4.0.1_1/bin/../lib/clang/4.0.1/lib/darwin/libclang_rt.osx.a, missing required architecture i386 in file /usr/local/Cellar/llvm#4/4.0.1_1/bin/../lib/clang/4.0.1/lib/darwin/libclang_rt.osx.a (2 slices)
ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/local/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/gokulalex/airflow/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-install-ye9ohe71/psutil/setup.py'"'"'; __file__='"'"'/private/var/folders/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-install-ye9ohe71/psutil/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/79/sh378bcd1n15fyw44lvjnml40000gn/T/pip-record-anu_rweq/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gokulalex/airflow/bin/../include/site/python3.6/psutil Check the logs for full command output.
Though I haven't gotten this error before, it looks like you might be missing some c headers which are important for this. Also please check your airflow installation to see if you are missing. From going through your debug log this error doesn't seem to be related to Python
I am following this tutorial - https://medium.com/#qazi/how-to-deploy-a-django-app-to-heroku-in-2018-the-easy-way-48a528d97f9c
so far I've:
built my Django app and ran locally - works perfectly
wrote Procfile with content
web: gunicorn project_name.wsgi
imported django_heroku to settings
I need to install psycopg2 so I ran pip install psycopg2
but getting the error
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/niamhtohill/ios_dev/vf_api/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-install-q5q1ago2/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-install-q5q1ago2/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 /private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-wheel-3u2cfbpc --python-tag cp37
cwd: /private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-install-q5q1ago2/psycopg2/
Complete output (144 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/compat.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_lru_cache.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/errors.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/psycopg
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100005 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/10.5/include -I/usr/local/Cellar/postgresql/10.5/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100005 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/10.5/include -I/usr/local/Cellar/postgresql/10.5/include/server -c psycopg/green.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/green.o
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=100005 -DHAVE_LO64=1 -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/10.5/include -I/usr/local/Cellar/postgresql/10.5/include/server -c psycopg/pqpath.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/pqpath.o
psycopg/pqpath.c:135:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(conn->pgconn) : PQresultStatus(*pgres)));
^~~~~~~~~~~~~~~~~~~~~~
psycopg/pqpath.c:1712:11: warning: code will never be executed [-Wunreachable-code]
ret = 1;
^
psycopg/pqpath.c:1817:17: warning: implicit conversion from enumeration type 'ConnStatusType' to different enumeration type 'ExecStatusType' [-Wenum-conversion]
PQstatus(curs->conn->pgconn) : PQresultStatus(curs->pgres)));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
....
...
...
...
...
...
...
/adapter_qstring.o build/temp.macosx-10.9-x86_64-3.7/psycopg/microprotocols.o build/temp.macosx-10.9-x86_64-3.7/psycopg/microprotocols_proto.o build/temp.macosx-10.9-x86_64-3.7/psycopg/typecast.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.9-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/niamhtohill/ios_dev/vf_api/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-install-q5q1ago2/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-install-q5q1ago2/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/kk/0xnrjqj950qdky6pkv1dws4r0000gn/T/pip-record-t0kpmijs/install-record.txt --single-version-externally-managed --compile --install-headers /Users/niamhtohill/ios_dev/vf_api/venv/bin/../include/site/python3.7/psycopg2 Check the logs for full command output.
really feel like im going round in circles! have retried the steps out 10 times
any help would be greatly appreciated
Instead of pip install psycopg2 try to run pip install psycopg2-binary.
psycopg2 is a wrapper around the libpq C library, and so it requires that library (plus other pre-requisites) to be installed before you can successfully run pip install psycopg2. The errors you see is probably related to that.
There's an alternative, which is to use the psycopg2-binary wheel package, which comes pre-packaged with its own version of C libraries (including libpq), meaning you don't need to go through all the pre-requisite steps.
$ pip install psycopg2-binary
The only cavaet is that psycopg2-binary is not recommended to be used in production environments.
This works for me:
pip install psycopg2-binary --user
I am trying to install pyinterval but running into this issue.I am trying to install this in my own virtual env. Also including the log below
Running setup.py install for pyinterval
Running command /home/jibin/Desktop/chef/env/bin/python -c "import setuptools, tokenize;__file__='/home/jibin/Desktop/chef/env/build/pyinterval/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hJmNF8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jibin/Desktop/chef/env/include/site/python2.7
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/interval
copying interval/__init__.py -> build/lib.linux-x86_64-2.7/interval
copying interval/imath.py -> build/lib.linux-x86_64-2.7/interval
copying interval/fpu.py -> build/lib.linux-x86_64-2.7/interval
copying ./LICENSE -> build/lib.linux-x86_64-2.7/interval
running build_ext
building 'crlibm' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/ext
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/crlibm/include -I/usr/include/python2.7 -c ext/crlibmmodule.c -o build/temp.linux-x86_64-2.7/ext/crlibmmodule.o
ext/crlibmmodule.c:7:20: fatal error: crlibm.h: No such file or directory
#include "crlibm.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /home/jibin/Desktop/chef/env/bin/python -c "import setuptools, tokenize;__file__='/home/jibin/Desktop/chef/env/build/pyinterval/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hJmNF8-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jibin/Desktop/chef/env/include/site/python2.7:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/interval
copying interval/__init__.py -> build/lib.linux-x86_64-2.7/interval
copying interval/imath.py -> build/lib.linux-x86_64-2.7/interval
copying interval/fpu.py -> build/lib.linux-x86_64-2.7/interval
copying ./LICENSE -> build/lib.linux-x86_64-2.7/interval
running build_ext
building 'crlibm' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/ext
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/opt/crlibm/include -I/usr/include/python2.7 -c ext/crlibmmodule.c -o build/temp.linux-x86_64-2.7/ext/crlibmmodule.o
ext/crlibmmodule.c:7:20: fatal error: crlibm.h: No such file or directory
#include "crlibm.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
As you can see I was able to build crlibm.h but can't seem to be able to include it.
I was trying to get mysql working with django. Installing the required bindings in an virtualenv using pip generates an error.
pip install MySQL-python
The package gets downloaded but I get the following error saying a header file my_config.h is missing.
(django)[jmathews#localhost pollsys]$ pip install MySQL-python
Downloading/unpacking MySQL-python
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/home/jmathews/.virtualenvs/django/build/MySQL-python/setup.py) egg_info for package MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -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 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -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 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1
_mysql.c:44:23: fatal error: my_config.h: No such file or directory
#include "my_config.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /home/jmathews/.virtualenvs/django/bin/python -c "import setuptools, tokenize;__file__='/home/jmathews/.virtualenvs/django/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Qa0mhq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jmathews/.virtualenvs/django/include/site/python2.7:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
creating build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -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 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -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 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1
_mysql.c:44:23: fatal error: my_config.h: No such file or directory
#include "my_config.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /home/jmathews/.virtualenvs/django/bin/python -c "import setuptools, tokenize;__file__='/home/jmathews/.virtualenvs/django/build/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Qa0mhq-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/jmathews/.virtualenvs/django/include/site/python2.7 failed with error code 1 in /home/jmathews/.virtualenvs/django/build/MySQL-python
Storing debug log for failure in /home/jmathews/.pip/pip.log
The following packages were installed and updated.
yum install -y gcc gcc-c++ libxml2-devel libxslt-devel
I also ran
yum groupinstall "Development Tools" "Development Libraries"
The problem persists. Is the problem with the package or any missing dependencies?
yum info mysql-devel
If it's not installed, install it
yum install mysql-devel
Now try
sudo pip install mysql-python
You need to install the header files for mysql library.
I don't know for your distrib, on Ubuntu the package name is libmysqlclient-dev.
By the way, if starting a new project, I would recommend PostgreSQL over MySQL, because support for MySQL is uncertain at best.
edit: turns out things change, there are now bindings for Python 3
Installing mysql-dev solved my problem as well. Thanks a lot!
yum install mysql-devel
and then
pip install MySQL-python