macOS如何安装mpi4py

前言

这次第一次我遇到的macOS安装python模块比win下安装要麻烦的!网上找了很多方案,也都尝试了,要么失败要么过于繁琐(=失败),最后终于找到一个方法,无痛解决安装问题!

安装方法

使用open-mpi携带安装:

  1. 打开mac的terminal终端:Press Command+Space and type Terminal and press enter/return key. Run in Terminal app:
  2. 输入命令:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null and press enter/return key.
    注意应该是需要输入开机密码:If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
    Run:
  3. 先安装open-mpi:brew install open-mpi
  4. 然后直接 pip install mpi4py 就完成了!
posted @ 2020-04-08 21:06  MrDoghead  阅读(1689)  评论(0编辑  收藏  举报