Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 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 Answer

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%

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...