最近需要涉及到机器学习需要安装mpi4py,之前一直安装有问题,后来通过官网文档,发现安装办法,特此记录:
参考文档:https://mpi4py.readthedocs.io/en/stable/install.html
https://mpi4py.readthedocs.io/en/stable/appendix.html#building-mpi
参考命令:
下载安装包:
wget http://www.mpich.org/static/downloads/3.3.1/mpich-3.3.1.tar.gz
wget https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.0.2.tar.gz
安装命令:
tar -zxvf mpich-3.3.1.tar.gz
cd mpich-3.3.1/
./configure –prefix=/usr/local/mpi
make && make install
cd mpi4py-3.0.2/
/root/anaconda3/bin/python setup.py build –mpicc=/usr/local/mpi/bin/mpicc
/root/anaconda3/bin/python setup.py install
验证:
/root/anaconda3/bin/python -c “import mpi4py; print(mpi4py);from mpi4py import MPI”
补充:
1.遇到了
ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
办法1:输入 pip install -U –ignore-installed wrapt enum34 simplejson netaddr
参考:https://www.cnblogs.com/xiaowei2092/p/11025155.html