IT Talks/Linux

python 의 sys.stderr.write(f"ERROR: {exc}") 오류

OJJ 2021. 5. 15. 11:44

갑자기 이런 메시지가 나온다면 ?

$ sudo python3 -m pip 
Traceback (most recent call last): 
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main 
    "__main__", mod_spec) 
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code 
    exec(code, run_globals) 
  File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 29, in <module> 
    from pip._internal.cli.main import main as _main 
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 58 
    sys.stderr.write(f"ERROR: {exc}") 
                                   ^ 
SyntaxError: invalid syntax

 

아래와 같이 실행하면 해결됨

$ wget https://bootstrap.pypa.io/pip/3.5/get-pip.py

$ python3 get-pip.py

 

반응형
1 2 3 4 5