griff
griff

Reputation: 131

python setup.py install syntax error on Windows

This is probably a dumb question but I am having trouble installing a module from a tar.gz file on Windows. The module is docx. Of course for docx one needs lxml and PIL which I had no problems installing because there are binaries available. For docx it appears I am out of luck.

So, I went about extracting the tarball with 7zip, using the command prompt to cd to the extracted directory with the setup.py file, then:

>>setup.py install

It appears to start working and then I get an error:

exec_(compile(source, fn, 'exec'), globs, locs)
File "setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT
                                    ^

Any ideas on this? Do I need a C++ compiler to run this?

Upvotes: 1

Views: 5473

Answers (3)

serakfalcon
serakfalcon

Reputation: 3531

This is probably too late to answer, but for anyone else reading this question, use Pillow, it's a better-maintained fork of PIL that works with python 3.x

Upvotes: 0

langiac
langiac

Reputation: 347

you open cmd,command : 1.cd 'to folder save module need install' path_to_python.exe setup.py build ... setup.py install done example:

cd C:\Python\Packet\tornado
C:\Python27\python.exe setup.py build
C:\Python27\python.exe setup.py install

Upvotes: 0

aIKid
aIKid

Reputation: 28272

Looks like the module doesn't support your python version. In Python 3.x, print is a function, which is why it throws an error.

Either install Python 2.x, or forget this module. Sorry.

Upvotes: 1

Related Questions