다음을 수행하려고 하면:
pip --version
알겠어요:
Traceback (most recent call last):
File "/usr/bin/pip", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3049, in <module>
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3033, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3062, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 660, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 673, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 858, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.3' distribution was not found and is required by the application
pip가 오래된 것 같아서 다음을 시도했습니다.
python -m pip install --upgrade pip
알겠어요:
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages (10.0.1)
그래서 혼란스러워요! pip에 필요한 버전으로 pip를 얻으려면 어떻게 해야 합니까?
설치에 대한 자세한 내용을 보려면 여기서 pip를 사용할 수 있음을 알려줍니다.
pip: /usr/bin/pip /usr/local/bin/pip /usr/local/bin/pip2.7
그리고 파이썬:
python: /usr/bin/python2.6-config /usr/bin/python2.6 /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python /usr/lib/python2.6 /usr/lib/python2.7 /usr/lib64/python2.6 /usr/lib64/python2.7 /usr/local/lib/python2.6 /usr/local/lib/python2.7 /usr/include/python2.6 /usr/include/python2.7 /usr/share/man/man1/python.1.gz
답변1
@Kusalananda가 말했듯이 /usr/bin 및 /usr/local/bin에는 여러 버전의 pip가 있습니다. /usr/bin에서 /usr/local/bin의 최신 버전으로의 심볼릭 링크를 만들어 문제를 해결했습니다.
sudo ln -s /usr/local/bin/pip /usr/bin/pip
답변2
심볼릭 링크를 사용하거나 최신 pip 버전을 사용하여 애플리케이션을 설치할 수 있습니다./usr/local/bin/