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/
Related
For the best part of today, I've been trying to get my head around how to install GDAL on my CentOS 8 server.
I've researched on many different answers and solutions across different sites and across StackOverflow and nothing seems to be working! (I'm probably missing something obvious somewhere)
I'm trying to install GDAL using the command pip3 install gdal
Which in return, produces the following error:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ydh0zt_x/gdal_e96fd73bd85b4e338f6c0fb234dcfaf1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ydh0zt_x/gdal_e96fd73bd85b4e338f6c0fb234dcfaf1/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 /tmp/pip-record-wx20mgo0/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/gdal
cwd: /tmp/pip-install-ydh0zt_x/gdal_e96fd73bd85b4e338f6c0fb234dcfaf1/
Complete output (28 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying gdal.py -> build/lib.linux-x86_64-3.6
copying ogr.py -> build/lib.linux-x86_64-3.6
copying osr.py -> build/lib.linux-x86_64-3.6
copying gdalconst.py -> build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdal.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdal_array.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/osr.py -> build/lib.linux-x86_64-3.6/osgeo
running build_ext
Could not run gdal-config!!!!
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/extensions
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/include/python3.6m -I. -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o
extensions/gdal_wrap.cpp:2813:10: fatal error: cpl_port.h: No such file or directory
#include "cpl_port.h"
^~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ydh0zt_x/gdal_e96fd73bd85b4e338f6c0fb234dcfaf1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ydh0zt_x/gdal_e96fd73bd85b4e338f6c0fb234dcfaf1/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 /tmp/pip-record-wx20mgo0/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/gdal Check the logs for full command output.
So far, I've installed:
Proj 6
GEOS
epel-release (For CentOS 8)
gdal-libs
PowerTools (I've also enabled powertools)
The error I've spotted within the output from above is cpl_port.h: No such file or directory and I have crosschecked this error across other forums, who have advised to run the following command:
sudo apt-get install libgdal-dev
and
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
And finally, running the pip3 install gdal command.
Although, since I'm running CentOS 8, I don't have access to "apt-get" and instead have tried using "Yum" but haven't had any luck with getting the above proposed solution to work.
Would anyone be able to suggest or recommend any methods of resolving the cpl_port.h: No such file or directory error on a CentOS 8 server?
Many thanks! :-)
It seems to be a bug with CentOS
https://bugs.centos.org/view.php?id=18213
gdal requires poppler-0.67, which is missing from official repositories.
It is however present in the raven-extras repo:
https://centos.pkgs.org/8/raven-extras-x86_64/poppler-0.67.0-22.el8.x86_64.rpm.html
Or you can download it as is (arbitrarily named poppler0.67.rpm here) and use it when installing gdal.
curl -o poppler0.67.rpm https://pkgs.dyn.su/el8/extras/x86_64/poppler-0.67.0-22.el8.x86_64.rpm
yum install -y gdal poppler0.67.rpm
Update: the bug seems to be resolved https://bugzilla.redhat.com/show_bug.cgi?id=1950024
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.
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'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/
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