jes516
jes516

Reputation: 552

How can i point pip to VCForPython27 in order to prevent "Unable to find vcvarsall.bat" error

I downloaded Microsoft Visual C++ Compiler for Python 2.7 and it installed in C:\Users\user\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat

However, I am getting the error: Unable to find vcvarsall.bat error when attempting to install "MySQL-python".

I added C:\Users\user\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0; to my Path.

I am using python 2.7.8

Upvotes: 1

Views: 3484

Answers (3)

user7956990
user7956990

Reputation: 1

Setting

SET DISTUTILS_USE_SDK=1
SET MSSdk=1

in Visual C++ 2008 Command Prompt worked for me.

Upvotes: 0

anon
anon

Reputation: 21

Use the command prompt shortcut provided from installing the MSI.

This will launch the prompt with VCVarsall.bat activated for the targeted environment.

Depending on your installation, you can find this in the Start Menu under All Program -> Microsoft Visual C++ For Python -> then pick the command prompt based on x64 or x86.

Otherwise, press Windows Key and search for "Microsoft Visual C++ For Python".

Upvotes: 2

jes516
jes516

Reputation: 552

this worked:

https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows

i uninstalled visual studio 2013 and net framework 4 first.

i didnt need visual studio. i only installed it because i was playing with c++.

this worked on a virtual environment:

add C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin; to System Paths

Start SDK Command Prompt
"C:\Program Files\Microsoft SDKs\Windows\v7.0\SetEnv.Cmd"

Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0.
Targeting Windows Server 2008 x64 DEBUG    

C:\Program Files\Microsoft SDKs\Windows\v7.0>setlocal enabledelayedexpansion
C:\Program Files\Microsoft SDKs\Windows\v7.0>set DISTUTILS_USE_SDK=1
C:\Program Files\Microsoft SDKs\Windows\v7.0>SetEnv.Cmd /x86 /release

Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.0.
Targeting Windows Server 2008 x86 RELEASE

C:\Program Files\Microsoft SDKs\Windows\v7.0>cd "C:\Users\USR01\virtualenvs\env1"
C:\Program Files\Microsoft SDKs\Windows\v7.0>.\Scripts\activate.bat
(env1) C:\Users\USR01\virtualenvs\env1>
(env1) C:\Users\USR01\virtualenvs\env1>pip install <module>
(env1) C:\Users\USR01\virtualenvs\env1>deactivate

Upvotes: 0

Related Questions