ImportError : pip라는 모듈이 없습니다. setup.py installiTerm에서

운영체제 : Mac OS X 10.7.5 Python Ver : 2.7.5

https://pypi.python.org/pypi/setuptools 에서 ez_setup.py와 함께 setuptools 1.0을 설치했습니다.
그런 다음 https://pypi.python.org/pypi/pip/1.4.1 에서 pip.1.4.1 pkg를 다운로드합니다. .

python setup.py installiTerm에서 (sudo) 를 실행 하면

running install
running bdist_egg running egg_info writing requirements to
pip.egg-info/requires.txt writing pip.egg-info/PKG-INFO writing
top-level names to pip.egg-info/top_level.txt writing dependency_links
to pip.egg-info/dependency_links.txt writing entry points to
pip.egg-info/entry_points.txt warning: manifest_maker: standard file
'setup.py' not found

reading manifest file 'pip.egg-info/SOURCES.txt' writing manifest file
'pip.egg-info/SOURCES.txt' installing library code to
build/bdist.macosx-10.6-intel/egg running install_lib warning:
install_lib: 'build/lib' does not exist -- no Python modules to
install

creating build/bdist.macosx-10.6-intel/egg creating
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/PKG-INFO -> build/bdist.macosx-10.6-intel/egg/EGG-INFO
copying pip.egg-info/SOURCES.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/dependency_links.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/entry_points.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/not-zip-safe ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/requires.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO copying
pip.egg-info/top_level.txt ->
build/bdist.macosx-10.6-intel/egg/EGG-INFO creating
'dist/pip-1.4.1-py2.7.egg' and adding
'build/bdist.macosx-10.6-intel/egg' to it removing
'build/bdist.macosx-10.6-intel/egg' (and everything under it)
Processing pip-1.4.1-py2.7.egg removing
'/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg'
(and everything under it) creating
/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg
Extracting pip-1.4.1-py2.7.egg to
/Users/dl/Library/Python/2.7/lib/python/site-packages pip 1.4.1 is
already the active version in easy-install.pth Installing pip script
to /Users/dl/Library/Python/2.7/bin Installing pip-2.7 script to
/Users/dl/Library/Python/2.7/bin

Installed
/Users/dl/Library/Python/2.7/lib/python/site-packages/pip-1.4.1-py2.7.egg
Processing dependencies for pip==1.4.1 Finished processing
dependencies for pip==1.4.1

그런 다음 입력 pip install하면 오류 메시지가 다음과 같이 표시됩니다.

Traceback (most recent call last):   File
"/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 9,
in <module>
load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()   File "build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 357, in
load_entry_point   File
"build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 2394, in
load_entry_point   File
"build/bdist.macosx-10.6-intel/egg/pkg_resources.py", line 2108, in
load ImportError: No module named pip

이전에 동일한 문제를 만났고 해결 방법을 알려줄 수있는 사람이 있습니까?



답변

나는 같은 문제가 있었다. 내 솔루션 :

Python 3의 경우

sudo apt-get install python3-pip

Python 2의 경우

sudo apt-get install python-pip


답변

Mac 에서는 apt-get을 사용할 수 없으므로 brew 를 사용하는 것이 더 나은 옵션 입니다. 명령:

컴퓨터에 python2와 python3이 모두 설치된 경우

python2.7 -m ensurepip --default-pip

단순히 문제를 해결해야합니다.

당신은 파이썬 3에서 핍 누락 대신 경우 단순히 변경 python2.7python3위의 명령.


답변

ez_setup을 설치 한 후 easy_install사용 가능 해야 합니다. 설치하려면 다음 pip을 수행하십시오.

easy_install pip


답변

macOS 10.15 및 Homebrew 2.1.6에서는 Python 3.7에서이 오류가 발생했습니다. 나는 단지 실행해야했습니다.

python3 -m ensurepip

이제 python3 -m pip나를 위해 작동합니다.


답변

pipPython을 통해 설치해보십시오 .

https://pip.pypa.io/en/stable/installing/ 로 이동 하십시오.

을 다운로드 get-pip.py하고 실행합니다.

(sudo) python get-pip.py


답변

nova 클라이언트를 설치하려고 할 때 이와 동일한 문제가 발생했습니다.

spencers-macbook-pro:python-novaclient root# python  setup.py install    
running install
/usr/bin/python: No module named pip
error: /usr/bin/python -m pip.__init__ install   'pbr>=0.5.21,<1.0' 'iso8601>=0.1.4' 'PrettyTable>=0.6,<0.8' 'requests>=1.1' 'simplejson>=2.0.9' 'six' 'Babel>=0.9.6' returned 1

나는 homebrew를 사용하므로 문제를 해결했습니다. sudo easy_install pip

spencers-macbook-pro:python-novaclient root# brew search pip
aespipe     brew-pip    lesspipe    pipebench   pipemeter   spiped  pipeviewer

If you meant "pip" precisely:

Homebrew provides pip via: `brew install python`. However you will then
have two Pythons installed on your Mac, so alternatively you can:
    sudo easy_install pip
spencers-macbook-pro:python-novaclient root# sudo easy_install pip

macports를 사용하는 경우 명령은 유사해야합니다.


답변

위의 답변 중 어느 것도 문제를 해결할 수 없다고 생각합니다.

나는 또한 한 번이 문제로 혼란스러워했습니다. pip공식 가이드 pip 설치 (현재 단일 Python 스크립트 실행 포함)에 따라 수동으로 설치해야합니다.get-pip.py )

그 후 sudo pip install Django. 오류가 사라집니다.