win10安装PyPy踩的坑(第三方库)
安装过程
下载PyPy
过程其实比较简单,官网下载相应的文件即可:
https://www.pypy.org/download.html
注意系统和python版本即可
安装
安装过程参考下面的教程:
https://blog.****.net/weixin_39121325/article/details/88655370
写的非常详细,不做赘述。
巨坑
“众所周知”,PyPy是没有自带第三方库的,需要自己安装,最常见的报错是:
error: Microsoft Visual C++ 14.1 is required. Get it with “Microsoft Visual C++ Build Tools”: https://visualstudio.microsoft.com/downloads/
有些朋友按照以上过程一顿操作猛如虎之后,就已经可以愉快的加速了,但是我的win10依旧会报错:ERROR: Command errored out with exit status 1
不管是scipy,还是numpy都会报错然后安装失败。百度了一天无果之后转向YouTube,Google,最后Google到一个帖子完美解决:
https://bitbucket.org/pypy/pypy/issues/3169/not-able-to-install-numpy-on-pypy3-windows
我做了三个操作:
- 将"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN"添加到环境变量中
- 在cmd中输入命令:
pypy3 -mpip install --upgrade setuptools - 将"mt.exe"放到"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN"路径下面,下载地址:https://github.com/eladkarako/mt/blob/master/x64/mt.exe
此时再输入"pypy3 -m pip install numpy":