Python - Zero length field name in format
centos, python
Solution
That error can only be raised if you run that code with Python 2.6 or older. In those versions, you must explicitly number the format fields for `str.format` (starting at `0`):
print('using EPR C API sources at "{0}"'.format(eprsrcdir))
Of course, this is only a temporary fix. It would be better to investigate why your code is not being run with Python 2.7 in the first place and then fix that instead.
Problem
I'm using Python on my Centos machine and when I try to run my program I have this error displayed : ``` 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 ``` I have already checked the other questions about this subject and I already installed Python 2.7.6 and set it as my default configuration as shown below.... ``` $ python -V Python 2.7.6 ``` Something must have gone wrong, but I don't know what. Anybody has an idea? Thanks