How to install mpi4py without sudo? - python

When I try to install mpi4py without sudo using pip install on Ubuntu 22, I get the following error (with sudo works fine):
ERROR: Command errored out with exit status 1:
command: /home/vedant/miniconda3/bin/python /home/vedant/miniconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp25az93fg
cwd: /tmp/pip-install-khu2q4rx/mpi4py_194f67e86692449fbf667e77b7a580c2
Complete output (404 lines):
running bdist_wheel
running build
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/bench.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/run.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__main__.py -> build/lib.linux-x86_64-cpython-39/mpi4py
creating build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_core.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__main__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
creating build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/dtlib.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/pkl5.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/py.typed -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__main__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/run.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/dl.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/MPI.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/bench.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
creating build/lib.linux-x86_64-cpython-39/mpi4py/include
creating build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/futures/pool.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/server.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__main__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/aplus.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_lib.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_core.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/util/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/dtlib.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/pkl5.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
running build_clib
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler: /usr/bin/mpicc
MPI C++ compiler: /usr/bin/mpicxx
MPI F compiler: /usr/bin/mpifort
MPI F90 compiler: /usr/bin/mpif90
MPI F77 compiler: /usr/bin/mpif77
checking for library 'lmpe' ...
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c _configtest.c -o _configtest.o
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat _configtest.o -llmpe -o _configtest
/home/vedant/miniconda3/compiler_compat/ld: cannot find -llmpe
collect2: error: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
building 'mpe' dylib library
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/src
creating build/temp.linux-x86_64-cpython-39/src/lib-pmpi
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/mpe.o
creating build/lib.linux-x86_64-cpython-39/mpi4py/lib-pmpi
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -shared -Wl,-rpath,/home/vedant/miniconda3/lib -Wl,-rpath-link,/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -Wl,-rpath,/home/vedant/miniconda3/lib -Wl,-rpath-link,/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -Wl,--no-as-needed build/temp.linux-x86_64-cpython-39/src/lib-pmpi/mpe.o -o build/lib.linux-x86_64-cpython-39/mpi4py/lib-pmpi/libmpe.so
checking for library 'vt-mpi' ...
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c _configtest.c -o _configtest.o
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat _configtest.o -lvt-mpi -o _configtest
/home/vedant/miniconda3/compiler_compat/ld: cannot find -lvt-mpi
collect2: error: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c _configtest.c -o _configtest.o
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat _configtest.o -lvt.mpi -o _configtest
/home/vedant/miniconda3/compiler_compat/ld: cannot find -lvt.mpi
collect2: error: ld returned 1 exit status
failure.
removing: _configtest.c _configtest.o
building 'vt' dylib library
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/vt.o
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -shared -Wl,-rpath,/home/vedant/miniconda3/lib -Wl,-rpath-link,/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -Wl,-rpath,/home/vedant/miniconda3/lib -Wl,-rpath-link,/home/vedant/miniconda3/lib -L/home/vedant/miniconda3/lib -Wl,--no-as-needed build/temp.linux-x86_64-cpython-39/src/lib-pmpi/vt.o -o build/lib.linux-x86_64-cpython-39/mpi4py/lib-pmpi/libvt.so
checking for library 'vt-mpi' ...
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/vedant/miniconda3/include -I/home/vedant/miniconda3/include -fPIC -O2 -isystem /home/vedant/miniconda3/include -fPIC -c _configtest.c -o _configtest.o
/usr/bin/mpicc -pthread -B /home/vedant/miniconda3/compiler_compat _configtest.o -lvt-mpi -o _configtest
/home/vedant/miniconda3/compiler_compat/ld: cannot find -lvt-mpi
collect2: error: ld returned 1 exit status
I have looked at this post: Installing mpi4py and run sudo apt install mpi, which has worked. So, which mpiexec prints /usr/bin/mpiexec.
I have read this post: Cannot install mpi4py on CentOS 7, and have done the following:
sudo apt install python3-mpi4py

Answer was to use conda instead of pip:
conda install -c conda-forge mpi
conda install -c conda-forge mpi4py

Related

pip: problem with the installation of mpi4py

I am trying to install mpi4py in default python environment used by anaconda:
python3.9 -m pip install mpi4py
which produces error during installation
python -m pip install mpi4py
Collecting mpi4py
Using cached mpi4py-3.1.3.tar.gz (2.5 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: mpi4py
Building wheel for mpi4py (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /home/gleb/anaconda3/bin/python /home/gleb/anaconda3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp75wsbtz5
cwd: /tmp/pip-install-84g0ez5h/mpi4py_2ac6e87b98de43d3827e1b2951c5c4ff
Complete output (156 lines):
running bdist_wheel
running build
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-cpython-39
creating build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/bench.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__main__.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/run.py -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py
creating build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__main__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_core.py -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
creating build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/dtlib.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/pkl5.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/__init__.py -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/py.typed -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__main__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/dl.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/MPI.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/bench.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/run.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
copying src/mpi4py/__init__.pxd -> build/lib.linux-x86_64-cpython-39/mpi4py
creating build/lib.linux-x86_64-cpython-39/mpi4py/include
creating build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-cpython-39/mpi4py/include/mpi4py
copying src/mpi4py/futures/_lib.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__main__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/aplus.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/pool.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/server.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/futures/_core.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/futures
copying src/mpi4py/util/dtlib.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/pkl5.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
copying src/mpi4py/util/__init__.pyi -> build/lib.linux-x86_64-cpython-39/mpi4py/util
running build_clib
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler: /home/gleb/anaconda3/bin/mpicc
MPI C++ compiler: /home/gleb/anaconda3/bin/mpicxx
MPI F compiler: /home/gleb/anaconda3/bin/mpifort
MPI F90 compiler: /home/gleb/anaconda3/bin/mpif90
MPI F77 compiler: /home/gleb/anaconda3/bin/mpif77
checking for library 'lmpe' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
building 'mpe' dylib library
creating build/temp.linux-x86_64-cpython-39
creating build/temp.linux-x86_64-cpython-39/src
creating build/temp.linux-x86_64-cpython-39/src/lib-pmpi
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/mpe.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
warning: build_clib: command '/home/gleb/anaconda3/bin/mpicc' failed with exit code 127
warning: build_clib: building optional library "mpe" failed
checking for library 'vt-mpi' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
building 'vt' dylib library
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/vt.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
warning: build_clib: command '/home/gleb/anaconda3/bin/mpicc' failed with exit code 127
warning: build_clib: building optional library "vt" failed
checking for library 'vt-mpi' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
building 'vt-mpi' dylib library
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/vt-mpi.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
warning: build_clib: command '/home/gleb/anaconda3/bin/mpicc' failed with exit code 127
warning: build_clib: building optional library "vt-mpi" failed
checking for library 'vt-hyb' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.ompi' ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
building 'vt-hyb' dylib library
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-cpython-39/src/lib-pmpi/vt-hyb.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
warning: build_clib: command '/home/gleb/anaconda3/bin/mpicc' failed with exit code 127
warning: build_clib: building optional library "vt-hyb" failed
running build_ext
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler: /home/gleb/anaconda3/bin/mpicc
MPI C++ compiler: /home/gleb/anaconda3/bin/mpicxx
MPI F compiler: /home/gleb/anaconda3/bin/mpifort
MPI F90 compiler: /home/gleb/anaconda3/bin/mpif90
MPI F77 compiler: /home/gleb/anaconda3/bin/mpif77
checking for dlopen() availability ...
checking for header 'dlfcn.h' ...
gcc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -I/home/gleb/anaconda3/include/python3.9 -c _configtest.c -o _configtest.o
success!
removing: _configtest.c _configtest.o
success!
checking for library 'dl' ...
gcc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -I/home/gleb/anaconda3/include/python3.9 -c _configtest.c -o _configtest.o
gcc -pthread -B /home/gleb/anaconda3/compiler_compat _configtest.o -Lbuild/temp.linux-x86_64-cpython-39 -ldl -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
checking for function 'dlopen' ...
gcc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -I/home/gleb/anaconda3/include/python3.9 -c _configtest.c -o _configtest.o
gcc -pthread -B /home/gleb/anaconda3/compiler_compat _configtest.o -Lbuild/temp.linux-x86_64-cpython-39 -ldl -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
building 'mpi4py.dl' extension
gcc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/home/gleb/anaconda3/include/python3.9 -c src/dynload.c -o build/temp.linux-x86_64-cpython-39/src/dynload.o
gcc -pthread -B /home/gleb/anaconda3/compiler_compat -shared -Wl,-rpath,/home/gleb/anaconda3/lib -Wl,-rpath-link,/home/gleb/anaconda3/lib -L/home/gleb/anaconda3/lib -L/home/gleb/anaconda3/lib -Wl,-rpath,/home/gleb/anaconda3/lib -Wl,-rpath-link,/home/gleb/anaconda3/lib -L/home/gleb/anaconda3/lib build/temp.linux-x86_64-cpython-39/src/dynload.o -Lbuild/temp.linux-x86_64-cpython-39 -ldl -o build/lib.linux-x86_64-cpython-39/mpi4py/dl.cpython-39-x86_64-linux-gnu.so
checking for MPI compile and link ...
/home/gleb/anaconda3/bin/mpicc -pthread -B /home/gleb/anaconda3/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/gleb/anaconda3/include -I/home/gleb/anaconda3/include -fPIC -O2 -isystem /home/gleb/anaconda3/include -fPIC -I/home/gleb/anaconda3/include/python3.9 -c _configtest.c -o _configtest.o
/home/gleb/anaconda3/bin/mpicc: line 301: x86_64-conda_cos6-linux-gnu-cc: command not found
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!
----------------------------------------
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py which use PEP 517 and cannot be installed directly
Then I tried
sudo pip install mpi4py
that installed the package correctly but into another python environment
so python does not see it
Python 3.9.12 (main, Apr 5 2022, 06:56:58)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mpi4py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'mpi4py'
Finally I've tried simply
sudo apt install python3-mpi4py
it installed package correclty but my python3 enviroment still does not see it.
I also tried
conda install -c conda-forge mpi4py
which does not work as well:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: - failed with initial frozen solve. Retrying with flexible solve.
how could I execute python3.9 -m pip install mpi4py with sudo ?

How to install GDAL in Ubuntu?

I've got Ubuntu 17.04 version installed and I want to install GDAL. I have tried several ways to install it, but always I've got an error. I have installed Python 2.7 and Python 3.6 but I want to do the install for Python 2.7
I have tried to do the installation following these steps:
sudo apt-get install libgdal-dev export
CPLUS_INCLUDE_PATH=/usr/include/gdal export
C_INCLUDE_PATH=/usr/include/gdal pip install GDAL
And I've got this error:
Collecting GDAL
Using cached GDAL-2.2.3.tar.gz
Installing collected packages: GDAL
Running setup.py install for GDAL ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iebgcn_u/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-x3vhb2t4-record/install-record.txt --single-version-externally-managed --compile:
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
copying gnm.py -> build/lib.linux-x86_64-3.6
creating 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/osr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gnm.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
Skipping optional fixer: ws_comma
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
Skipping optional fixer: ws_comma
running build_ext
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/extensions
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o -L../../.libs -L../../ -lgdal -o build/lib.linux-x86_64-3.6/osgeo/_gdal.cpython-36m-x86_64-linux-gnu.so
building 'osgeo._gdalconst' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/gdalconst_wrap.c -o build/temp.linux-x86_64-3.6/extensions/gdalconst_wrap.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/extensions/gdalconst_wrap.o -L../../.libs -L../../ -lgdal -o build/lib.linux-x86_64-3.6/osgeo/_gdalconst.cpython-36m-x86_64-linux-gnu.so
building 'osgeo._osr' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/osr_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/osr_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
extensions/osr_wrap.cpp:3339:13: warning: ‘void GDALPythonFreeCStr(void*, int)’ defined but not used [-Wunused-function]
static void GDALPythonFreeCStr(void* ptr, int bToFree)
^~~~~~~~~~~~~~~~~~
extensions/osr_wrap.cpp:3309:14: warning: ‘char* GDALPythonObjectToCStr(PyObject*, int*)’ defined but not used [-Wunused-function]
static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
^~~~~~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/extensions/osr_wrap.o -L../../.libs -L../../ -lgdal -o build/lib.linux-x86_64-3.6/osgeo/_osr.cpython-36m-x86_64-linux-gnu.so
building 'osgeo._ogr' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/ogr_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/ogr_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/extensions/ogr_wrap.o -L../../.libs -L../../ -lgdal -o build/lib.linux-x86_64-3.6/osgeo/_ogr.cpython-36m-x86_64-linux-gnu.so
building 'osgeo._gnm' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/gnm_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gnm_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
extensions/gnm_wrap.cpp:3321:13: warning: ‘void GDALPythonFreeCStr(void*, int)’ defined but not used [-Wunused-function]
static void GDALPythonFreeCStr(void* ptr, int bToFree)
^~~~~~~~~~~~~~~~~~
extensions/gnm_wrap.cpp:3291:14: warning: ‘char* GDALPythonObjectToCStr(PyObject*, int*)’ defined but not used [-Wunused-function]
static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
^~~~~~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-Bsymbolic-functions -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/extensions/gnm_wrap.o -L../../.libs -L../../ -lgdal -o build/lib.linux-x86_64-3.6/osgeo/_gnm.cpython-36m-x86_64-linux-gnu.so
running install_lib
copying build/lib.linux-x86_64-3.6/gdal.py -> /usr/local/lib/python3.6/dist-packages
error: could not create '/usr/local/lib/python3.6/dist-packages/gdal.py': Permission denied
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-iebgcn_u/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-x3vhb2t4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-iebgcn_u/GDAL/
If I execute the last command withs sudo: sudo pip install GDAL. I've got this another error ...
The directory '/home/josecarlos/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/josecarlos/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Collecting GDAL Downloading GDAL-2.2.3.tar.gz (475kB)
100% |████████████████████████████████| 481kB 1.3MB/s Installing collected packages: GDAL Running setup.py install for GDAL ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0rp6w4f8/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-w7crvfsd-record/install-record.txt --single-version-externally-managed --compile:
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
copying gnm.py -> build/lib.linux-x86_64-3.6
creating 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/osr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalconst.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/ogr.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gnm.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/__init__.py -> build/lib.linux-x86_64-3.6/osgeo
copying osgeo/gdalnumeric.py -> build/lib.linux-x86_64-3.6/osgeo
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
Skipping optional fixer: ws_comma
Fixing build/lib.linux-x86_64-3.6/gdal.py build/lib.linux-x86_64-3.6/ogr.py build/lib.linux-x86_64-3.6/osr.py build/lib.linux-x86_64-3.6/gdalconst.py build/lib.linux-x86_64-3.6/gnm.py build/lib.linux-x86_64-3.6/osgeo/gdal.py build/lib.linux-x86_64-3.6/osgeo/gdal_array.py build/lib.linux-x86_64-3.6/osgeo/osr.py build/lib.linux-x86_64-3.6/osgeo/gdalconst.py build/lib.linux-x86_64-3.6/osgeo/ogr.py build/lib.linux-x86_64-3.6/osgeo/gnm.py build/lib.linux-x86_64-3.6/osgeo/__init__.py build/lib.linux-x86_64-3.6/osgeo/gdalnumeric.py
Skipping optional fixer: ws_comma
running build_ext
building 'osgeo._gdal' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/extensions
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I../../port -I../../gcore -I../../alg -I../../ogr/ -I../../ogr/ogrsf_frmts -I../../gnm -I../../apps -I/usr/include/python3.6m -I. -I/usr/include -c extensions/gdal_wrap.cpp -o build/temp.linux-x86_64-3.6/extensions/gdal_wrap.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
extensions/gdal_wrap.cpp:3168:10: fatal error: cpl_port.h: No existe el archivo o el directorio
#include "cpl_port.h"
^~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
---------------------------------------- Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0rp6w4f8/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-w7crvfsd-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0rp6w4f8/GDAL/
How can I install GDAL in Ubuntu?
maybe you'll have more choices if you download the package and read the readme.txt.
downloadpage
im not that confident with all those command parameters on my own.
hope it helps^^
Maybe the problem is the Ubuntu version more than Python. I didn't find much information about ubuntu 17, so you should try what is available for the older and more stable versions.
I have Ubuntu 18.04 and this answer seems to help her, too. According to comments it also worked on Ubuntu 16.04 and 14.04:
If you don't have any gdal previous version installed
Open your terminal and type
sudo add-apt-repository -y ppa:ubuntugis/ppa
sudo apt update
sudo apt install gdal-bin python-gdal python3-gdal
If you have a previous version installed
Open your terminal and type
sudo add-apt-repository -y ppa:ubuntugis/ppa
sudo apt update
sudo apt upgrade

cx_Freeze build error?

I am trying to create a binary from a python,flask and boto3 app. I am having trouble running the pip install cx_Freeze command too work. I am getting the following error :
It seems to be not fetching the right system libraries. Also, can anyone suggest any tools to package python apps into binaries?
Failed building wheel for cx-Freeze
Running setup.py clean for cx-Freeze
Failed to build cx-Freeze
Installing collected packages: cx-Freeze
Running setup.py install for cx-Freeze ... error
Complete output from command /home/shaswat.g/.virtualenvs/flask_app/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yLvkz9/cx-Freeze/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-kKRaSM-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/shaswat.g/.virtualenvs/flask_app/include/site/python2.7/cx-Freeze:
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/cx_Freeze
copying cx_Freeze/dist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/main.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/common.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/__init__.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/macdist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/finder.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/setupwriter.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/windist.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/hooks.py -> build/lib.linux-x86_64-2.7/cx_Freeze
copying cx_Freeze/freezer.py -> build/lib.linux-x86_64-2.7/cx_Freeze
creating build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
copying cx_Freeze/initscripts/SharedLibSource.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
copying cx_Freeze/initscripts/__startup__.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
copying cx_Freeze/initscripts/SharedLib.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
copying cx_Freeze/initscripts/ConsoleSetLibPath.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
copying cx_Freeze/initscripts/Console.py -> build/lib.linux-x86_64-2.7/cx_Freeze/initscripts
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
copying cx_Freeze/samples/relimport/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
copying cx_Freeze/samples/relimport/relimport.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/relimport
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
copying cx_Freeze/samples/service/Config.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
copying cx_Freeze/samples/service/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
copying cx_Freeze/samples/service/ServiceHandler.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/service
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/openpyxl
copying cx_Freeze/samples/openpyxl/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/openpyxl
copying cx_Freeze/samples/openpyxl/test_openpyxl.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/openpyxl
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
copying cx_Freeze/samples/simple/hello.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
copying cx_Freeze/samples/simple/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/simple
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/matplotlib
copying cx_Freeze/samples/matplotlib/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/matplotlib
copying cx_Freeze/samples/matplotlib/matplotlib_eg.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/ matplotlib
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
copying cx_Freeze/samples/PyQt4/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
copying cx_Freeze/samples/PyQt4/PyQt4app.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/PyQt4
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
copying cx_Freeze/samples/advanced/advanced_1.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
copying cx_Freeze/samples/advanced/advanced_2.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
copying cx_Freeze/samples/advanced/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/advanced
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/asmodule
copying cx_Freeze/samples/asmodule/asmodule.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/asmodule
copying cx_Freeze/samples/asmodule/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/asmodule
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
copying cx_Freeze/samples/zope/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
copying cx_Freeze/samples/zope/qotd.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/zope
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
copying cx_Freeze/samples/Tkinter/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
copying cx_Freeze/samples/Tkinter/SimpleTkApp.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/Tkinter
creating build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
copying cx_Freeze/samples/wx/setup.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
copying cx_Freeze/samples/wx/wxapp.py -> build/lib.linux-x86_64-2.7/cx_Freeze/samples/wx
running build_ext
building 'cx_Freeze.util' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/source
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/util.c -o build/temp.linux-x86_64-2.7/source/util.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/ python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/source/util.o -o build/ lib.linux-x86_64-2.7/cx_Freeze/util.so
creating build/temp.linux-x86_64-2.7/source/bases
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-HVkOs2/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c source/bases/ Console.c -o build/temp.linux-x86_64-2.7/source/bases/Console.o
creating build/lib.linux-x86_64-2.7/cx_Freeze/bases
x86_64-linux-gnu-gcc -pthread build/temp.linux-x86_64-2.7/source/bases/Console.o -L/usr/lib/python2.7/ config-x86_64-linux-gnu -lpython2.7 -o build/lib.linux-x86_64-2.7/cx_Freeze/bases/Console -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lpthread -ldl -lutil -lm -L/usr/lib -lz -s
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/shaswat.g/.virtualenvs/flask_app/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yLvkz9/cx-Freeze/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-kKRaSM-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/shaswat.g/.virtualenvs/flask_app/include/site/python2.7/cx-Freeze" failed with error code 1 in /tmp/pip-build-yLvkz9/cx-Freeze/
Just do
sudo apt install zlib1g-dev
I was trying to install cx-freeze to convert some python code to an exe but the problem was /usr/bin/ld: cannot find -lz just like you. The file being fetched is compressed (cx_Freeze-5.1.1.tar.gz) so you need zlib. Of course use pip3 for python3.
pip never installs system libraries, it only concerns itself with Python libs.
It seems you need to install zlib before installing cx_Freeze.
Another tool to generate binaries is PyInstaller.
This solution works for me on centos8
yum install gcc
yum install python3-devel
pip install wheel
pip install importlib-metadata
pip install patchelf
pip3 install cx-Freeze

How do I install mysql-python for python2.7

How do I install mysql-python for python2.7. The following script seems to use -I/usr/include/mysql which is empty, but I do have other folders like /usr/include/mysql51 and /usr/include/mysql55 which seem to contain header files.
sudo pip install MYSQL-python --allow-all-external
I got the following error:
Collecting MYSQL-python
Using cached MySQL-python-1.2.5.zip
Installing collected packages: MYSQL-python
Running setup.py install for MYSQL-python
building '_mysql' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -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-i686-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX
_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 /usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vXN9gu/MYSQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dKaHt3-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-i686-2.7
copying _mysql_exceptions.py -> build/lib.linux-i686-2.7
creating build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-i686-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-i686-2.7/MySQLdb
creating build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.linux-i686-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-i686-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.linux-i686-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=pentium4 -fasynchronous-unwind-tables -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-i686-2.7/_mysql.o -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -fPIC -DUNIV_LINUX -DUNIV_LINUX
_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
----------------------------------------
Command "/usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vXN9gu/MYSQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dKaHt3-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vXN9gu/MYSQL-python
Why you wanted to face all those problems yourself? This was already resolved by package maintainers. Do:
yum install MySQL-python
Consider installing devel package
sudo yum install mysql-devel
Then install mysql-python using pip or yum:
pip install mysql-python OR sudo yum install MySQL-python

Psycopg2 Error: clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

Been trying to install psycopg2 in a multitude of ways, but I keep getting an error similiar to this one:
$ pip install psycopg2
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.4.tar.gz (682kB): 682kB downloaded
Running setup.py (path:/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py) egg_info for package psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090304 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.4/include -I/usr/local/Cellar/postgresql/9.3.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip-igitig-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/__init__.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/_json.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/_range.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/extensions.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/pool.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/psycopg1.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
copying lib/tz.py -> build/lib.macosx-10.9-intel-2.7/psycopg2
creating build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/__init__.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_async.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_cancel.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_connection.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_copy.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_cursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_dates.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_green.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_lobject.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_module.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_notify.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_quote.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_transaction.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/test_with.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/testconfig.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
copying tests/testutils.py -> build/lib.macosx-10.9-intel-2.7/psycopg2/tests
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/psycopg
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.4 (dt dec pq3 ext)" -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DPG_VERSION_HEX=0x090304 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I. -I/usr/local/Cellar/postgresql/9.3.4/include -I/usr/local/Cellar/postgresql/9.3.4/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-intel-2.7/psycopg/psycopgmodule.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip-igitig-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/6p/0z5pjhdn47b7r2x0c4fjy3tw0000gp/T/pip_build_nir/psycopg2
Storing debug log for failure in /Users/nir/Library/Logs/pip.log
I have tried many commands including reinstalling postgresql and django-toolbelt. Nothing seemed to make a difference, the same 'type' of error would occur. I also included postgresql to my $PATH with: export PYTHONPATH=$PYTHONPATH:/Library/PostgreSQL/9.3/bin/pg_config
I am on OSX Maverick. I am running python 2.7 and django 1.6.
Any Ideas?
I don't actually know the answer, but, I searched around a bit as I use all of the components you are having issues with. I ran into this:
http://kaspermunck.github.io/2014/03/fixing-clang-error/
So, you might try something like:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install psycopg2
It seems the issue is that the cc command line includes arguments that don't make sense to cc, and it used to be a soft error, but now it is a fatal error. Good Luck!
-g

Categories

Resources