windows - Kunne ikke downloade python-pakken

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg har for nylig installeret python 3 i min Windows 8 computer.
Når jeg forsøger at downloade den numpy-pakke ved hjælp af pip fra kommandolinjen, virker den ikke.


Her er en prøve af output:


f:pythonlibdistutilsdist.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).


Original undtagelse var:


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


og


"f:pythonpython.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('
', '
');f.close();


I første omgang viser det downloadet af pakken, som synes at være downloadet korrekt, kun under installationen, at jeg ser nogle fejl ...

Bedste reference


Numpy har flere komponenter, der skal kompileres, derfor har du brug for en C ++ compiler, som den fra Visual Studio installeret:


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


Det er normalt lettere at bruge Python Extension-pakkerne leveret af Christoph Gohlke eller en Python-distribution som Anaconda on Windows, som vil give binarierne til dig. [5] [6]