0

I am trying to install mpi4py as described in the guide. When I do

python setup.py build --mpicc=/usr/bin/mpicc 

(or even without last argument), I get following error:

building 'mpi4py.MPI' extension
/usr/bin/mpicc -fPIC -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -I/usr/include/python3.4m -c src/MPI.c -o build/temp.linux-i686-3.4/src/MPI.o
In file included from src/MPI.c:3:0:
src/mpi4py.MPI.c:8:22: fatal error: pyconfig.h: No such file or directory
 #include "pyconfig.h"
                      ^
compilation terminated.
error: command '/usr/bin/mpicc' failed with exit status 1

What might be the problem?

1 Answer 1

2

may be you need to install python-dev:

sudo apt-get install python-dev

using pip:

sudo apt-get install pip
sudo pip install mpi4py

you can install it using apt-get directly:

sudo apt-get install python-mpi4py
Sign up to request clarification or add additional context in comments.

4 Comments

Yes, that helped. But now I get another error: /usr/bin/ld: cannot find -lz collect2: error: ld returned 1 exit status
compiling from source, you need to install all dependencies , better to use pip.
Last comamnd helped! Thanks a lot!
@Bob anytime , enjoy Python :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.