【发布时间】:2017-01-03 16:23:33
【问题描述】:
我有将 python 从 3.5 升级到 3.6 的坏主意。现在我无法重新安装我使用的任何软件包(scipy、numpy、..)。
我使用的命令pip3 install -U numpy
pip3 --version 返回
pip 9.0.1
我有 Visual Studio 2015 社区的许可安装。
我在 Win7 x64 上,我设置为 env var VS100COMNTOOLS=%VS140COMNTOOLS%
我得到的巨大错误的最后 5 行是:
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "c:\users\admin\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\admin\\AppData\\Local\\Temp\\pip-build-65uc3b3g\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(c
ode, __file__, 'exec'))" install --record C:\Users\admin\AppData\Local\Temp\pip-huz2nklc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\admin\AppData\Local\Temp\pip-build-65uc3b3g\numpy\
【问题讨论】:
-
您可以从 Christoph Gohlke 获得已经编译好的版本,而不是从源代码编译:lfd.uci.edu/~gohlke/pythonlibs/#numpy 这样可以避免这个问题
-
您有“Microsoft Visual C++ 14.0”吗?如错误消息所述,在landinghub.visualstudio.com/visual-cpp-build-tools 找到它...
-
@Bakuriu 正如我所说,我有一个许可的 Visual Studio 2015,所以我有 Visual C++ 编译器。
标签: python python-3.x numpy installation python-3.6