살아가는 이야기
Python pip 업그레이드 오류 본문
Python 3.x에서도 pip을 업그레이드할 때 오류가 발생하는 경우가 있다. 이런 경우에는 다음과 같이 upgrade하라는 말만 앵무새처럼 반복하게 된다.
>python -m pip install --upgrade pip
Requirement already satisfied: pip in c:\users\woogyun\appdata\roaming\python\python38\site-packages (20.3.3)
Collecting pip
Using cached pip-21.2.1-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.3
Uninstalling pip-20.3.3:
Successfully uninstalled pip-20.3.3
Rolling back uninstall of pip
Moving to c:\users\woogyun\appdata\roaming\python\python38\scripts\pip.exe
from C:\Users\woogyun\AppData\Local\Temp\pip-uninstall-bk8_0qa5\pip.exe
Moving to c:\users\woogyun\appdata\roaming\python\python38\scripts\pip3.8.exe
from C:\Users\woogyun\AppData\Local\Temp\pip-uninstall-bk8_0qa5\pip3.8.exe
Moving to c:\users\woogyun\appdata\roaming\python\python38\scripts\pip3.exe
from C:\Users\woogyun\AppData\Local\Temp\pip-uninstall-bk8_0qa5\pip3.exe
Moving to c:\users\woogyun\appdata\roaming\python\python38\site-packages\pip-20.3.3.dist-info\
from C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\~ip-20.3.3.dist-info
Moving to c:\users\woogyun\appdata\roaming\python\python38\site-packages\pip\
from C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\~ip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 224, in _main
status = self.run(options, args)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\req_command.py", line 180, in wrapper
return func(self, options, args)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 394, in run
installed = install_given_reqs(
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\__init__.py", line 82, in install_given_reqs
requirement.install(
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\req\req_install.py", line 816, in install
install_wheel(
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\install\wheel.py", line 837, in install_wheel
_install_wheel(
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\install\wheel.py", line 747, in _install_wheel
generated_console_scripts = maker.make_multiple(scripts_to_generate)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 418, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_internal\operations\install\wheel.py", line 483, in make
return super(PipScriptMaker, self).make(specification, options)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 407, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 307, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 242, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\woogyun\AppData\Roaming\Python\Python38\site-packages\pip\_vendor\distlib\scripts.py", line 386, in _get_launcher
raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
WARNING: You are using pip version 20.3.3; however, version 21.2.1 is available.
You should consider upgrading via the 'C:\Python38\python.exe -m pip install --upgrade pip' command.
그럴 때에는 get-pip.py 파일을 받아서 실행하면 된다. get-pip.py는 다음 URL에서 받을 수 있는데, 그냥 누르면 파일 내용이 열리므로 마우스 우클릭 후 "다른 이름으로 링크 저장..." 메뉴를 선택하여 get-pip.py란 이름으로 저장한다.
https://bootstrap.pypa.io/get-pip.py
get-pip.py를 받은 후에는 저장된 폴더를 열고 그 폴더에서 Shift-우클릭을 통해 명령 프롬프트를 연 다음 일반 Python 프로그램처럼 이를 실행해 준다.
>python get-pip.py
Collecting pip
Using cached pip-21.2.1-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.3
Uninstalling pip-20.3.3:
Successfully uninstalled pip-20.3.3
Successfully installed pip-21.2.1
이렇게 pip를 성공적으로 업그레이드할 수 있다.
다음은 이 방법으로 pip를 업그레이드한 스크린샷이다.
Comments