Не удалось загрузить пакет Python - PullRequest
0 голосов
/ 08 мая 2018

Я недавно установил Python 3 на мой компьютер с Windows 8.Когда я пытаюсь загрузить пакет numpy с помощью pip из командной строки, он не работает.

Вот пример выходных данных:

f:\python\lib\distutils\dist.py:274: UserWarning: Unknown distribution 
option: 'define_macros'
warnings.warn(msg)
running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Could not initialize compiler instance: do you have Visual Studio
installed?  If you are trying to build with MinGW, please use "python setup.py
build -c mingw32" instead.  If you have Visual Studio installed, check it is
correctly installed, and the right version (VS 2008 for python 2.6, 2.7 and 3.2,
VS 2010 for >= 3.3).

Исходное исключение было:

[WinError 3] The system cannot find the path specified: 'F:\\Visual Studio\\VC\\PlatformSDK\\lib', and the Compiler class was MSVCCompiler

и

"f:\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\MATRIX~1.MAT\\AppData\\Local\\Temp\\pip-install-rxex02t4\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();

Сначала он показываетзагрузка пакета, которая, кажется, загружена правильно, только во время процесса установки, что я вижу некоторые ошибки ...

1 Ответ

0 голосов
/ 08 мая 2018

Numpy имеет несколько компонентов, которые необходимо скомпилировать, поэтому вам необходим компилятор C ++, такой как установленный из Visual Studio:

error: Could not initialize compiler instance: do you have Visual Studio installed?

Обычно проще использовать Пакеты расширений Python, предоставленные Кристофом Гольке , или дистрибутив Python, такой как Anaconda для Windows, который предоставит вам двоичные файлы.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...