IT Talks/Linux

python ์˜ sys.stderr.write(f"ERROR: {exc}") ์˜ค๋ฅ˜

OkOJJ 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

 

728x90