我试图使用以下命令安装PIL ( Python图像库):
pip install PIL --allow-unverified PIL --allow-all-external看到以下错误:
gkhan@Gkan ~ $ pip install PIL --allow-unverified PIL --allow-all-external
Collecting PIL
PIL is potentially insecure and unverifiable.
Downloading http://effbot.org/media/downloads/PIL-1.1.7.tar.gz (506kB)
100% |████████████████████████████████| 507kB 1.5MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-egu_a9q6/PIL/setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-egu_a9q6/PIL发布于 2015-10-07 02:28:40
您的系统上的python命令运行Python3,但是PIL的设置脚本是为Python2编写的。Python2和Python3是两种不同的语言;它们看起来非常相似,但它们不兼容,其中一个不同之处是,print需要Python3中的括号,而不是Python2中的括号。
如果这些命令可用,则运行pip2或pip2.7而不是pip3。否则,类似于python2.7 /usr/bin/pip install …的东西应该能工作。
请注意,到目前为止,我们建议python成为Python 2只是少数发行版(至少是Arch)将Python3安装为/usr/bin/python。
https://unix.stackexchange.com/questions/234366
复制相似问题