簡體   English   中英

從python 3.5更新到3.6:無法安裝任何軟件包

[英]update from python 3.5 to 3.6: unable to install any packages

我有將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\

最簡單的方法是安裝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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM