Python, failed to install. Exit code: 1 windows 10

2020-04-16 02:30发布

问题:

So, I have going over this back and forth, I tried several of the solutions on this forum, none worked.

I have pip3 installed, Python 3.4, Visual Studio 2015 on Windows 10.

Now whenever I run the installing for a new module manually or through pip3 I get the following error:

Say I use the cmdline as such:

pip3 install numpy

I get :

error: Unable to find vcvarsall.bat

----------------------------------------
Command "c:\users\ariel\appdata\local\programs\python\python35-32\python.exe -c 
"import setuptools, tokenize;__file__='C:\\Users\\Ariel
\\AppData\\Local\\Temp\\pip-build-41rz6w_o\\numpy\\setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))" install --record 
C:\Users\Ariel\AppData\Local\Temp\pip-vuq3ap0m-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1
in C:\Users\Ariel\AppData\Local\Temp\pip-build-41rz6w_o\numpy

If I download it and run it from the folder

 setup.py install

I get

build_src
building py_modules sources
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Unable to find vcvarsall.bat

Please help, considering to just use linux with python... less issues

回答1:

This is based on @Jim answers in the comment section, basically make sure that you have the C++ compiler and windows SDK installed!

My problem was that when I installed Visual Studio, I did not select the windows SDK.