【问题标题】:update from python 3.5 to 3.6: unable to install any packages从 python 3.5 更新到 3.6:无法安装任何软件包
【发布时间】: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\

【问题讨论】:

标签: python python-3.x numpy installation python-3.6


【解决方案1】:

最简单的方法是安装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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-29
    • 2010-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-06
    • 1970-01-01
    相关资源
    最近更新 更多