티스토리 뷰

반응형

pip 를 통해 패키지를 설치하려고 했는데, 다음과 같이 오류가 나는 상황이 존재한다.

결론부터 말하면, 버전이 너무 오래되서 8.1.2 에서 22.2.2 로 바로 업데이트를 못하는 상황이다.

변경사항이 너무 많기 때문에, 과거버전에서 바로 업데이트하는것이 미지원 되는걸로 보인다.

$ sudo pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/4b/30/e15b806597e67057e07a5acdc135216ccbf76a5f1681a324533b61066b0b/pip-22.2.2.tar.gz (2.0MB)
    100% |████████████████████████████████| 2.0MB 507kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-aNaQsF/pip/setup.py", line 7
        def read(rel_path: str) -> str:
                         ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aNaQsF/pip/
You are using pip version 8.1.2, however version 22.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

해결방법

설치를 할때 다음과 같이 20.3 을 중간버전을 설치후 시도를 해보자.

# 중간버전 설치하고
pip install --upgrade pip==20.3

# 가장 최근 버전으로 업데이트
pip install --upgrade pip

이러면 다음과 같이 최근 버전으로 업데이트가 성공적으로 완료된다.

$ sudo pip install --upgrade pip==20.3
Collecting pip==20.3
  Downloading https://files.pythonhosted.org/packages/55/73/bce122d1ed0217b3c1a3439ab16dfa94bbeabd0d31755fcf907493abf39b/pip-20.3-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 693kB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-20.3
You are using pip version 20.3, however version 22.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.


$ sudo pip install --upgrade pip
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pip
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 14.8 MB/s 
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3
    Uninstalling pip-20.3:
      Successfully uninstalled pip-20.3
Successfully installed pip-20.3.4

 

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함