【发布时间】:2016-02-14 10:06:51
【问题描述】:
我在我的 Centos 机器上使用 Python,当我尝试运行我的程序时,我显示了这个错误:
Running setup.py egg_info for package pyepr
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pyepr/setup.py", line 68, in <module>
print('using EPR C API sources at "{}"'.format(eprsrcdir))
ValueError: zero length field name in format
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pyepr/setup.py", line 68, in <module>
print('using EPR C API sources at "{}"'.format(eprsrcdir))
ValueError: zero length field name in format
我已经检查了关于这个主题的其他问题,并且我已经安装了 Python 2.7.6 并将其设置为我的默认配置,如下所示......
$ python -V
Python 2.7.6
一定是出了什么问题,但我不知道是什么。
有人有想法吗?
谢谢
【问题讨论】:
-
您的脚本肯定是使用比 2.7.6 更旧的 python 版本执行的。
-
您是在运行
python setup.py install还是在使用pip或easy_install?如果您使用的是pip或easy_install,他们可能没有使用正确的python 版本。 -
在脚本中尝试
import sys; print(sys.version)以确定实际版本。