Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

visual studio 2010 - Cannot find vcvarsall.bat when running a Python script

I am working on Vista, and using Python 2.6.4. I am using a software that utilizes a Python script, but bumped into the message:

cannot find vcvarsall.bat

So, I installed visual c++ 2010. Still the file is not found - though, it is there. My guess (a very uneducated one...) is that somewhere the path is wrong, because I also have an old visual 2008 (pretty empty) folder. I have no idea where to make the changes for the new path. Do I change something in the registry or in the script? Or somewhere else?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems that Python is looking explicitly for Visual Studio 2008. I encountered this problem where it couldn't find vcvarsall.bat even though it was on the path.

It turns out that Visual Studio 2010 creates the following environment variable:

SET VS100COMNTOOLS=C:Program FilesMicrosoft Visual Studio 10.0Common7Tools

The fix is to create a variable called VS90COMNTOOLS and have that point to your Visual Studio 2010 common tools folder, e.g.

SET VS90COMNTOOLS=C:Program FilesMicrosoft Visual Studio 10.0Common7Tools

That fixed it for me and I can now build packages using the Visual Studio 2010 compiler.

You can also set the VS90 environment variable to point to the VS100 environment variable using the command below:

SET VS90COMNTOOLS=%VS100COMNTOOLS%

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...