Cannot find vcvarsall.bat - python-3.x

NOTE: I have seen multiple answers to no avail, so please look at the solution and my failed solutions list before showing as duplicate.
Hey,
So I got a new computer (Old Windows w/ Python 3.4), so I installed Python 3.5 on my new one. I started to install modules until I came across an error like this:
C:\Users\Samuel>pip install noise
Collecting noise
Using cached noise-1.2.2.tar.gz
Installing collected packages: noise
Running setup.py install for noise
Complete output from command "c:\program files\python 3.5\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-build-e9dlwpm2\\noise\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Samuel\AppData\Local\Temp\pip-7tgvnyfe-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\noise
copying perlin.py -> build\lib.win-amd64-3.5\noise
copying setup.py -> build\lib.win-amd64-3.5\noise
copying shader.py -> build\lib.win-amd64-3.5\noise
copying shader_noise.py -> build\lib.win-amd64-3.5\noise
copying test.py -> build\lib.win-amd64-3.5\noise
copying __init__.py -> build\lib.win-amd64-3.5\noise
running build_ext
building 'noise._simplex' extension
error: Unable to find vcvarsall.bat
----------------------------------------
Command ""c:\program files\python 3.5\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-build-e9dlwpm2\\noise\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Samuel\AppData\Local\Temp\pip-7tgvnyfe-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Samuel\AppData\Local\Temp\pip-build-e9dlwpm2\noise
I tried to use easy_install as a substitute, but that came with 1) an access denied error (Overcome w/ admin privelages) and 2) Not being able to find vcvarsall.bat
Because of this, I installed Visual Studio 2015 and Visual C++ 2008.
No difference.
I added the path to vcvarsall.bat to the PATH.
No difference.
I added the path to vcvarsall.bat to VS100COMNTOOLS, VS140COMNTOOLS and VS90COMNTOOLS.
No difference.
Running pip and easy_install again w/ admin permission, wearing my lucky socks.
No difference.
Installed and ran Miniconda as suggested by one of the Stack Overflow answers.
Didn't find a single package I needed. Turns out it's not looking for PyPI anyway.
I have no idea how to solve this. Do I need to revert to Python 3.4?
SPECS
Windows 10 x86 64-bit
Python 3.5
VS 2015, VC++ 2008 installed

I think you have the wrong C++: VC++ 2008 is for Python before 3.3.
The VC++ 2015 that you need comes when you install Visual Studio 2015 but you need to explicitly specify the C++ (check the box) for the C++ (2015) in the custom installation options. Try changing that via a re-installation.
Just tried it:
Windows 10 x86 64-bit
Python 3.5
VS 2015 But with the Visual C++ install option checked
Then pip install noise worked fine.

Related

Docker: Move LibXMLSec settings / dependencies into executable directory

So. I'm trying to get my Dockerfile to run.
Dockerfile is complicated, and doing things somewhat wrong for Python. The important part, though, is that it was working before I added XMLSec to the dependencies. (via the onelogin [https://github.com/onelogin/python-saml] package)
On our non-Dockerized systems, we run:
apt install -y libxml2-dev libxmlsec1-dev libxmlsec1-openssl pkg-config
and it installs the dependencies. My containerized attempts, however, run into this issue:
Running setup.py install for xmlsec: started
Running setup.py install for xmlsec: finished with status 'error'
Complete output from command /usr/local/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-wd6h548m/xmlsec/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-ufxw9hor/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'src/xmlsec/__init__.py' not found (or not a regular file)
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/xmlsec
copying src/xmlsec/py.typed -> build/lib.linux-x86_64-3.6/xmlsec
copying src/xmlsec/constants.pyi -> build/lib.linux-x86_64-3.6/xmlsec
copying src/xmlsec/template.pyi -> build/lib.linux-x86_64-3.6/xmlsec
copying src/xmlsec/__init__.pyi -> build/lib.linux-x86_64-3.6/xmlsec
copying src/xmlsec/tree.pyi -> build/lib.linux-x86_64-3.6/xmlsec
running build_ext
error: Unable to invoke pkg-config.
The solution seems to be to use the XMLSec library as a compiled Wheel. (Per something I read in the XMLSec github) I can't find any documentation on how to add this compiled wheel into an executable location within the container via the Dockerfile.
I've done quite a bit of research on this, and can't find sample code or the exact answer. I it may be obvious, but I'm missing core knowledge.

How to install ChainerCV

I am using Win 10. I tried installing ChainerCV through pip. I want to know what can be done to solve this problem. Also what is behind this issue: not having VisualStudio, dependency issues or any other thing. Is having CUDA necessary to run ChainerCV?
P.S I have chainer and other dependencies running properly.
Stack Trace:
copying chainercv\utils\bbox_nms_gpu_post.c -> build\lib.win-amd64-3.5\chainercv\utils\bbox
running build_ext
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
Failed building wheel for chainercv
Running setup.py clean for chainercv
Failed to build chainercv
Installing collected packages: chainercv
Running setup.py install for chainercv ... error
Complete output from command c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile:
building 'chainercv.utils.bbox._nms_gpu_post' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
Command "c:\users\dell\appdata\local\programs\python\python35\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Dell\AppData\Local\Temp\pip-record-cl7d0zn_\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pip-install-qjghd97d\chainercv\
are you trying on admin ? else please follow below steps
open cmd using Ctrl + r then type cmd and try to install from there
pip install ChainerCV

Pandas installation not recognising a C++ install

I'm installing Pandas along with a few others dependencies for a graph theory project on a new machine.
I'm installing all the dependencies with pip, with Pandas being installed with pip install pandas.
The installation fails with:
running build_ext
building 'pandas._libs.algos' extension
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:\program files (x86)\python37-32\python.exe" -u -c "import setuptool
s, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-q9t
aeyul\\pandas\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read
().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" instal
l --record C:\Users\USER\AppData\Local\Temp\pip-record-9bazi_ha\install-reco
rd.txt --single-version-externally-managed --compile" failed with error code 1 i
n C:\Users\USER\AppData\Local\Temp\pip-install-q9taeyul\pandas\
I have then proceeded to install the Microsoft Visual C++ 2015 Redist 14.0 from this link.
The C++ 2015 Redist version numbers are 14.0.23026 for 64-bit and 14.0.24215 for 32-bit. I also have various other C++ Redists from other years, down to 2005.
I restarted the computer after installing the Redist, just to ensure there are no problems on that front. However, I'm still getting the same error.
I'm on Windows 8.1.
Visual C++ Redistributable installs run-time libraries and can be used to run applications written with VC. But you need Visual C++ compiler! So install Build Tools.

Installing Sklearn from Source on Windows 7

I am on Windows 7 (64 bit) and have Python 3.4 installed along with the other stated required dependencies for the sklearn python package [NumPy (>= 1.6.1), SciPy (>= 0.9)]. I installed Numpy and SciPy from the .whl files I found online that matched python 3.4. I am trying to install the sklearn package by calling pip install sklearn (FYI, I am trying to do this install without using Python (x.y) because I want python 3.x). the pip install sklearn command will run for a while, but then I get the following error:
copying sklearn\tests\__init__.py -> build\lib.win-amd64-3.4\sklearn\tests
running build_clib
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_clib
building 'libsvm-skl' library
compiling C sources
error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279
----------------------------------------
Command "c:\python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\jjaaae\\AppData\\Local\\Temp\\pip-build-43xaawp2\\scikit-learn\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\jjaaae\AppData\Local\Temp\pip-7i3ghuri-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\jjaaae\AppData\Local\Temp\pip-build-43xaawp2\scikit-learn\
I have tried to install Microsoft Windows SDK 7.1 as it describes in the error message. I have also restarted the command prompt and my computer, but I still get this error message. What am I missing?
I found the problem. The download file for Microsoft Windows SDK 7.1 allows you to "install" it even if you don't have .Net 4.x installed yet. I must have gotten click happy during the install and missed that warning. So the install for SDK 7.1 was really fast and didn't install what I needed. When I backed up, installed Microsoft .NET Framework 4 from this URL first, then installed SDK 7.1 per instructions it worked.

pip install in Cygwin cannot find file error

I am on a Mac OS El Capitan, running a Windows 10 64-bit VM inside Parallels. I have Cygwin installed and Anaconda3. I would like to install two packages (pyrsistent and rpy2) using pip. Both of them throw an error "error: [WinError 2] The system cannot find the file specified" without specifying the file it can't find.
Here's the output:
$ pip install pyrsistent
Collecting pyrsistent
Using cached pyrsistent-0.11.9.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in c:\anaconda3\lib\site-packages (from pyrsistent)
Building wheels for collected packages: pyrsistent
Running setup.py bdist_wheel for pyrsistent
Complete output from command C:\Anaconda3\python.exe -c "import setuptools;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\cygwin64\tmp\tmpn25raothpip-wheel-:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
copying _pyrsistent_version.py -> build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_checked_types.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_field_common.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_helpers.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_immutable.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pbag.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pclass.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pdeque.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_plist.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pmap.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_precord.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pset.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_pvector.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\_transformations.py -> build\lib.win-amd64-3.5\pyrsistent
copying pyrsistent\__init__.py -> build\lib.win-amd64-3.5\pyrsistent
running build_ext
building 'pvectorc' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for pyrsistent
Failed to build pyrsistent
Installing collected packages: pyrsistent
Running setup.py install for pyrsistent
Complete output from command C:\Anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\cygwin64\tmp\pip-_wbdiief-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building 'pvectorc' extension
error: [WinError 2] The system cannot find the file specified
----------------------------------------
Command "C:\Anaconda3\python.exe -c "import setuptools, tokenize;__file__='C:\\cygwin64\\tmp\\pip-build-sqcinj9m\\pyrsistent\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\cygwin64\tmp\pip-_wbdiief-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\cygwin64\tmp\pip-build-sqcinj9m\pyrsistent
Both python3 and pip are in the path:
$ which pip
/cygdrive/c/Anaconda3/Scripts/pip
$ which python
/cygdrive/c/Anaconda3/python
The error is identical when trying to install rpy2 so it's not something particular to the package I'm trying to install. Does anyone have ideas of the problem or ideas for troubleshooting? I've tried debugging into the install.py but the code throwing the error is in C. I've tried doing the install in verbose mode, but it still doesn't say what file it cannot find in that case.
(and if you're wondering why I haven't used conda, it's because it doesn't install pyrsistent, and for the rpy2 install, it insists on linking it to its own install of R, and even when specifying my own install, something doesn't link correctly. I've already been down that road and would like to stick to pip).
Here is a workaround for anyone who is stuck installing python packages on Windows. There are several sites that have Windows binaries for python packages. I was able to find a binary for rpy2 here but there are several other sites too, if you just google something like "python Windows binaries". Then I did:
pip install rpy2-2.7.4-cp35-none-win_amd64.whl
pyrsistent was not in that website or any of several other binaries websites I found. But someone else on my dev team sent me the /pyrsistent directory inside his Anaconda3/Lib/site-packages directory and after copying it to the same directory on my machine, I was able to import pyrsistent as well.
It's not pretty, but it worked.

Resources