本文主要介绍Python中,执行pip install --upgrade pip命令升级pip后,报错sys.stderr.write(f“ERROR: {exc}”)的问题解决方法。
报错信息:
Traceback (most recent call last): File "/usr/bin/pip2", line 9, in <module> load_entry_point('pip==21.0', 'console_scripts', 'pip2')() File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point return ep.load() File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60 sys.stderr.write(f"ERROR: {exc}") ^ SyntaxError: invalid syntax
问题原因及解决方法:https://www.cjavapy.com/article/1605/