Python - field name of zero length in format

I use Python on my Centos computer, and when I try to run my program, I see this error:

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 already checked other questions on this, and I already installed Python 2.7.6 and set it as the default configuration as shown below ....

 $ python -V
 Python 2.7.6

Something went wrong, but I don’t know what.

Does anyone have an idea?

thank

+4
source share
2 answers

This error can only be raised by running this code with Python 2.6 or later. In these versions, you must explicitly specify format fields for str.format(starting with 0):

print('using EPR C API sources at "{0}"'.format(eprsrcdir))

, . , Python 2.7 , .

+6

sudo, Python sudo path. , sudo , .

-1

Source: https://habr.com/ru/post/1548364/


All Articles