質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
MPI

MPIは、並列プログラミングを利用するための標準化規格、及び実装自体のことを指します。バイト列で構成されたメッセージとして、いくつかのCPUが情報を送受信することにより協調動作を可能にします。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

2回答

9947閲覧

Ubuntuでのpip install mpi4pyができない

yuki0000

総合スコア12

MPI

MPIは、並列プログラミングを利用するための標準化規格、及び実装自体のことを指します。バイト列で構成されたメッセージとして、いくつかのCPUが情報を送受信することにより協調動作を可能にします。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

Ubuntu

Ubuntuは、Debian GNU/Linuxを基盤としたフリーのオペレーティングシステムです。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2018/03/05 08:30

前提・実現したいこと

Bash on Ubuntu on Windows
Ubuntu 16.04.3 LTS
anaconda3-5.1.0
という環境で
pip install mpi4py
を実行したところ、下のようなメッセージが出ました。

このコマンドをエラーなく実行したいです。

最後の数行にエラーのまとめ的なものがあるのはわかるのですが、
ここから何をすればいいのかわかりません。

要するに
Building wheels for collected packages: mpi4py
ができていないことはわかりました。

発生している問題・エラーメッセージ

username@DESKTOP-F7B6US2:~$ pip install mpi4py Collecting mpi4py Downloading mpi4py-3.0.0.tar.gz (1.4MB) 100% |████████████████████████████████| 1.4MB 1.0MB/s Building wheels for collected packages: mpi4py Running setup.py bdist_wheel for mpi4py ... error Complete output from command /home/username/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8zxw1o7r/mpi4py/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/tmpjqih1l9ipip-wheel- --python-tag cp36: running bdist_wheel ---------------------------------------------- 中略 ---------------------------------------------- removing: _configtest.c _configtest.o _configtest building 'mpi4py.dl' extension gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/home/username/anaconda3/include/python3.6m -c src/dynload.c -o build/temp.linux-x86_64-3.6/src/dynload.o gcc -pthread -shared -B /home/username/anaconda3/compiler_compat -L/home/username/anaconda3/lib -Wl,-rpath=/home/username/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/src/dynload.o -Lbuild/temp.linux-x86_64-3.6 -ldl -o build/lib.linux-x86_64-3.6/mpi4py/dl.cpython-36m-x86_64-linux-gnu.so checking for MPI compile and link ... gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/username/anaconda3/include/python3.6m -c _configtest.c -o _configtest.o _configtest.c:2:17: fatal error: mpi.h: No such file or directory compilation terminated. failure. removing: _configtest.c _configtest.o error: Cannot compile MPI programs. Check your configuration!!! ---------------------------------------- Failed building wheel for mpi4py Running setup.py clean for mpi4py Failed to build mpi4py Installing collected packages: mpi4py Running setup.py install for mpi4py ... error Complete output from command /home/username/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8zxw1o7r/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-ublkswyp-record/install-record.txt --single-version-externally-managed --compile: ---------------------------------------------- 中略 ---------------------------------------------- removing: _configtest.c _configtest.o _configtest checking for function 'dlopen' ... gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/username/anaconda3/include/python3.6m -c _configtest.c -o _configtest.o gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ _configtest.o -Lbuild/temp.linux-x86_64-3.6 -ldl -o _configtest success! removing: _configtest.c _configtest.o _configtest building 'mpi4py.dl' extension gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_DLFCN_H=1 -DHAVE_DLOPEN=1 -I/home/username/anaconda3/include/python3.6m -c src/dynload.c -o build/temp.linux-x86_64-3.6/src/dynload.o gcc -pthread -shared -B /home/username/anaconda3/compiler_compat -L/home/username/anaconda3/lib -Wl,-rpath=/home/username/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/src/dynload.o -Lbuild/temp.linux-x86_64-3.6 -ldl -o build/lib.linux-x86_64-3.6/mpi4py/dl.cpython-36m-x86_64-linux-gnu.so checking for MPI compile and link ... gcc -pthread -B /home/username/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/username/anaconda3/include/python3.6m -c _configtest.c -o _configtest.o _configtest.c:2:17: fatal error: mpi.h: No such file or directory compilation terminated. failure. removing: _configtest.c _configtest.o error: Cannot compile MPI programs. Check your configuration!!! Command "/home/username/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8zxw1o7r/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-ublkswyp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-8zxw1o7r/mpi4py/

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

mpiヘッダーのパスが通ってないです。

インストール済みであれば、パスを確認してください。
そうでないのなら、インストールしてください。
http://discexuno.wp.xdomain.jp/2016/09/15/openmpiをxubuntu-16-04にインストール/
https://www.devmanuals.net/install/ubuntu/ubuntu-16-04-LTS-Xenial-Xerus/how-to-install-openmpi-bin.html

投稿2018/03/05 13:06

mkgrei

総合スコア8560

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yuki0000

2018/03/05 14:00

パスを通すことで見事に動きました。ありがとうございました。
guest

0

そのパッケージでよく起こるエラーのようです。ちょっと調べると対応方法を書いたサイトもいくつかありました。
https://yoheikoga.github.io/2017/09/13/install-mpi4py-in-python36/

投稿2018/03/05 11:22

Udomomo

総合スコア1524

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問