0

我有将 python 从 3.5 升级到 3.6 的坏主意。现在我无法重新安装我使用的任何软件包(scipy、numpy、..)。

我使用的命令pip3 install -U numpy

pip3 --version返回

pip 9.0.1

我有 Visual Studio 2015 社区的许可安装。

我在 Win7 x64 上,我设置为 env varVS100COMNTOOLS=%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\
4

1 回答 1

0

最简单的方法是安装Miniconda

接下来,创建一个 Python 3.6 环境:

conda create -n py36 Python=3.6 

激活它:

activate py36

提示应更改为:

(py36)

并开始安装你的包:

conda install numpy 

您可能希望添加频道conda-forge以增加可用包的数量:

conda config --add channels conda-forge
于 2017-01-03T17:54:00.113 回答