GDAL (CentOS 8) Install Failing - python

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

Related

I am trying to install pywinpty, But Getting below error

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/

"error: command 'gcc' failed with exit status 1" when trying to install python-language-server [duplicate]

This question already has answers here:
fatal error: Python.h: No such file or directory
(35 answers)
Closed 2 years ago.
I've below pip installed in my system
$ pip --version
pip 19.3.1 from /usr/lib/python3.8/site-packages/pip (python 3.8)
python version installed in my system is -
$ python --version
Python 3.8.3
I'm trying to install python-language-server and encountered below error -
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-yoqmgayp/ujson/setup.py'"'"'; file='"'"'/tmp/pip-install-yoqmgayp/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-h4azsb93/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-yoqmgayp/ujson/
Complete output (16 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.8
creating build/temp.linux-x86_64-3.8/python
creating build/temp.linux-x86_64-3.8/lib
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./python -I./lib -I/usr/include/python3.8 -c ./python/ujson.c -o build/temp.linux-x86_64-3.8/./python/ujson.o -D_GNU_SOURCE
In file included from ./python/ujson.c:39:
./python/py_defines.h:39:10: fatal error: Python.h: No such file or directory
39 | #include
| ^~~~~~~~~~
compilation terminated.
error: command '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-yoqmgayp/ujson/setup.py'"'"'; file='"'"'/tmp/pip-install-yoqmgayp/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-h4azsb93/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
Below is my OS details -
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 32 (Thirty Two)
Release: 32
Codename: ThirtyTwo
How can I fix this error?
If you read the word message, it tells you what is wrong
./python/py_defines.h:39:10: fatal error: Python.h: No such file or directory
It says it can't find the header file. Ask dnf about what provides it:
sudo dnf provides '*/Python.h'
Then install that package (sudo dnf install ...) and retry your original command.

"libusb.h: No such file or directory" from gcc compiling Python module

I'm getting this kind of error and I was unable to find the right answer on the internet.
I tried to update the controller software of my NZXT Kraken water pump and it won't start now.
https://gitlab.com/leinardi/gkraken
I would be really thankful for some guidance.
Here is my full error:
Running setup.py install for hidapi ... error
ERROR: Complete output from command /usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-7z0im1kt/hidapi/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-ox5wudk7/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_ext
cythoning hid.pyx to hid.c
/usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hid.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
cythoning hidraw.pyx to hidraw.c
/usr/local/lib64/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-7z0im1kt/hidapi/hidraw.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'hid' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/hidapi
creating build/temp.linux-x86_64-3.7/hidapi/libusb
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 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hid.c -o build/temp.linux-x86_64-3.7/hid.o
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 -fPIC -Ihidapi/hidapi -I/usr/include/libusb-1.0 -I/usr/include/python3.7m -c hidapi/libusb/hid.c -o build/temp.linux-x86_64-3.7/hidapi/libusb/hid.o
hidapi/libusb/hid.c:26: warning: "_GNU_SOURCE" redefined
26 | #define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
|
<command-line>: note: this is the location of the previous definition
hidapi/libusb/hid.c:47:10: fatal error: libusb.h: No such file or directory
47 | #include <libusb.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-7z0im1kt/hidapi/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-ox5wudk7/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-7z0im1kt/hidapi/ ```
This was solved by running:
sudo dnf install libusbx-devel libudev-devel

GDAL installation error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1"

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.

Why is pip installation of pyOpenSSL 0.13 failing?

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/

Categories