sudo pip install mpi4py and get the following errors

Issue #179 resolved
ANDREW created an issue

The directory '/home/andrew/.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/andrew/.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 mpi4py
Downloading https://files.pythonhosted.org/packages/ec/8f/bbd8de5ba566dd77e408d8136e2bab7fdf2b97ce06cab830ba8b50a2f588/mpi4py-3.0.3.tar.gz (1.4MB)
100% |████████████████████████████████| 1.4MB 519kB/s
Installing collected packages: mpi4py
Running setup.py install for mpi4py ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-6Qljsl/mpi4py/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-cpYZng-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_src
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/main.py -> build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/init.py -> build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/bench.py -> build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/run.py -> build/lib.linux-x86_64-2.7/mpi4py
creating build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/main.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/server.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/_base.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/_lib.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/init.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/aplus.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/futures/pool.py -> build/lib.linux-x86_64-2.7/mpi4py/futures
copying src/mpi4py/libmpi.pxd -> build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/init.pxd -> build/lib.linux-x86_64-2.7/mpi4py
copying src/mpi4py/MPI.pxd -> build/lib.linux-x86_64-2.7/mpi4py
creating build/lib.linux-x86_64-2.7/mpi4py/include
creating build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.linux-x86_64-2.7/mpi4py/include/mpi4py
running build_clib
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler: /usr/local/bin/mpicc
MPI C++ compiler: /usr/local/bin/mpicxx
MPI F compiler: /usr/local/bin/mpifort
MPI F90 compiler: /usr/local/bin/mpif90
MPI F77 compiler: /usr/local/bin/mpif77
checking for library 'lmpe' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o


The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
building 'mpe' dylib library
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lib-pmpi
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c src/lib-pmpi/mpe.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/mpe.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
warning: build_clib: command '/usr/local/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "mpe" failed

checking for library 'vt-mpi' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
building 'vt' dylib library
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c src/lib-pmpi/vt.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
warning: build_clib: command '/usr/local/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt" failed

checking for library 'vt-mpi' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
building 'vt-mpi' dylib library
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c src/lib-pmpi/vt-mpi.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-mpi.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
warning: build_clib: command '/usr/local/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt-mpi" failed

checking for library 'vt-hyb' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.ompi' ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
building 'vt-hyb' dylib library
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -c src/lib-pmpi/vt-hyb.c -o build/temp.linux-x86_64-2.7/src/lib-pmpi/vt-hyb.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
warning: build_clib: command '/usr/local/bin/mpicc' failed with exit status 1

warning: build_clib: building optional library "vt-hyb" failed

running build_ext
MPI configuration: [mpi] from 'mpi.cfg'
MPI C compiler:    /usr/local/bin/mpicc
MPI C++ compiler:  /usr/local/bin/mpicxx
MPI F compiler:    /usr/local/bin/mpifort
MPI F90 compiler:  /usr/local/bin/mpif90
MPI F77 compiler:  /usr/local/bin/mpif77
checking for dlopen() availability ...
checking for header 'dlfcn.h' ...
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _configtest.c -o _configtest.o
success!
removing: _configtest.c _configtest.o
success!
checking for library 'dl' ...
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _configtest.c -o _configtest.o
x86_64-linux-gnu-gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-2.7 -ldl -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
checking for function 'dlopen' ...
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _configtest.c -o _configtest.o
x86_64-linux-gnu-gcc -pthread _configtest.o -Lbuild/temp.linux-x86_64-2.7 -ldl -o _configtest
success!
removing: _configtest.c _configtest.o _configtest
building 'mpi4py.dl' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/usr/include/python2.7 -c src/dynload.c -o build/temp.linux-x86_64-2.7/src/dynload.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -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-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC build/temp.linux-x86_64-2.7/src/dynload.o -Lbuild/temp.linux-x86_64-2.7 -ldl -o build/lib.linux-x86_64-2.7/mpi4py/dl.so
checking for MPI compile and link ...
/usr/local/bin/mpicc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-gnDdqE/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _configtest.c -o _configtest.o
--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
/home/andrew/anaconda3/envs/sdriving/bin/x86_64-conda-linux-gnu-cc in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-6Qljsl/mpi4py/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-cpYZng-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-6Qljsl/mpi4py/

Comments (3)

  1. Lisandro Dalcin

    We are slowly moving development to GitHub, please submit your issues there next time.

    First of all, please fix the permissions of your /home/andrew/.cache/pip/http directory. Actually, i may be a good idea to rm -rf ~/.cache/pip to start fresh.

    Your Open MPI comes from conda-forge, and the compiler package is not installed. This can be fixed with conda install openmpi-mpicc. But perhaps you want instead to conda install mpi4py, then there is no no need to use pip and install the missing compiler package.

  2. ANDREW reporter

    Great! Thank you, Lisandro, it works well according to your suggestions, thank you for your help again.

  3. Log in to comment