2

I am working with win 7. Installed Python 2.7. I am trying to setup the source code downloaded from "http://effbot.org/downloads#tkinter3000" tkinter3000-1.0-20031212.zip [57k] it throws this error:

G:\Python\tkinter3000-1.0-20031212>python setup.py install
using Tcl/Tk libraries at C:\Python27\Tcl
using Tcl/Tk version 8.5
running install
running build
running build_py
creating build
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\WCK
copying WCK\Utils.py -> build\lib.win-amd64-2.7\WCK
copying WCK\wckTkinter.py -> build\lib.win-amd64-2.7\WCK
copying WCK\__init__.py -> build\lib.win-amd64-2.7\WCK
creating build\lib.win-amd64-2.7\tk3
copying tk3\__init__.py -> build\lib.win-amd64-2.7\tk3
running build_ext
building '_tk3draw' extension
error: Unable to find vcvarsall.bat

I don't have visual studio. Please suggest a workaround to move ahead.

elixenide
  • 44,308
  • 16
  • 74
  • 100
Prag Rao
  • 1,411
  • 3
  • 11
  • 10

3 Answers3

2

In order to compile certain Python 2.7 components you need a c compiler installed. The compiler expected when looking for VCVarsAll is Microsoft Visual C++. Microsoft has released a redistributable of the C++ Compiler for use with Python 2.7 that can be retrieved from the following link.

http://aka.ms/vcpython27

Chris Wilcox
  • 327
  • 2
  • 7
  • 3
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – worldofjr Jan 22 '15 at 19:06
  • Thanks for the feedback. While this link is a redirect that my team maintains, I will elaborate on the answer here to make sure there is no confusion in the future. – Chris Wilcox Mar 26 '15 at 22:32
1

I had the same problem as you and, as explained here, for Python 2.7 you should use the 3.5 version of the Windows SDK which comes with a C compiler.

After installing you have to call the SetEnv.Cmd script that will to all the trick with the environment variables. I call it with SetEnv /x64 /release, but you should check for aditional flags.

I had a problem with my version (German) of Windows 7 and the SetEnv.Cmd was not working properly. This is because the variable names were wrapped between !! (exclamation marks) instead of %% (percentage symbols). I just replaced them manually and it worked fine...

Saullo G. P. Castro
  • 56,802
  • 26
  • 179
  • 234
-1

Download Microsoft Visual C++ Compiler for Python 2.7 from

http://www.microsoft.com/en-us/download/details.aspx?id=44266

Then don't forget to load setuptools and not distutils, because distutils has not yet been updated to support this compiler.

gaborous
  • 15,832
  • 10
  • 83
  • 102
bignano
  • 573
  • 5
  • 21