OS: Mac OS X 10.7.5 Python Ver: 2.7.5
python setup.py install in iTerm shows that
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
Then I inputed
pip install, the error message showed like that
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
Anyone who met the same problem before and can give me some tips to solve it?
I had the same problem. My solution:
For Python 3
sudo apt-get install python3-pip
For Python 2
sudo apt-get install python-pip
On Mac using brew is a better option as apt-get is not available. Command:
brew install python
In case you have both python2 & python3 installed on machine
python2.7 -m ensurepip --default-pip
simply should solve the issue.
If instead you are missing pip from python 3 then simply change
python3 in the command above.
With macOS 10.15 and Homebrew 2.1.6 I was getting this error with Python 3.7. I just needed to run:
python3 -m ensurepip
python3 -m pip works for me.
After installing ez_setup, you should have
easy_install available. To install
pip just do:
Try to install
pip through Python:
Please go to: https://pip.pypa.io/en/stable/installing/
get-pip.py, and then run:
(sudo) python get-pip.py
I ran into this same issue when I attempted to install the nova client.
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
I use homebrew so I worked around the issue with
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
The commands should be similar if you use macports.
I think none of these answers above can fix your problem.
after that, just
sudo pip install Django.
The error will be gone.
I know this thread is old, but I just solved the problem for myself on OS X differently than described here.
Basically I reinstalled Python 2.7 through brew, and it comes with pip.
Install Xcode if not already:
Install Brew as described here:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then install Python through Brew:
brew install python
And you’re done. In my case I just needed to install pyserial.
pip install pyserial
On some kind of linux like ubuntu, first, do apt-get update and then try installing the python-pip package. without apt-get update, you might get error such as
E: Unable to locate package python-pip
sudo apt-get update
2.Install the pip package
sudo apt-get install python-pip
sudo apt-get install python3-pip
pip binaries from here and it resolved the issue.
In terminal try this:
ls -lA /usr/local/bin | grep pip
in my case i get:
-rwxr-xr-x 1 root root 284 Сен 13 16:20 pip -rwxr-xr-x 1 root root 204 Окт 27 16:37 pip2 -rwxr-xr-x 1 root root 204 Окт 27 16:37 pip2.7 -rwxr-xr-x 1 root root 292 Сен 13 16:20 pip-3.4
So pip2 || pip2.7 in my case works, and pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Then run the following command in the folder where you downloaded: get-pip.py
my py version is 3.7.3, and this cmd worked
python3.7 -m pip install requests
requests library – for retrieving data from web APIs.
This runs the pip module and asks it to find the requests library on PyPI.org (the Python Package Index) and install it in your local system so that it becomes available for you to import
I solved a similar error on Linux by setting PYTHONPATH to the site-packages location. This was after running
python get-pip.py --prefix /home/chet/pip.
[[email protected] ~]$ ~/pip/bin/pip -V Traceback (most recent call last): File "/home/chet/pip/bin/pip", line 7, in <module> from pip import main ImportError: No module named pip [[email protected] ~]$ export PYTHONPATH=/home/chet/pip/lib/python2.6/site-packages [[email protected] ~]$ ~/pip/bin/pip -V pip 9.0.1 from /home/chet/pip/lib/python2.6/site-packages (python 2.6)
Tested below for Linux: You can directly download pip from https://pypi.org/simple/pip/ untar and use directly with your latest python.
tar -xvf pip-0.2.tar.gz cd pip-0.2
Check for the contents.
anant$ ls docs pip.egg-info pip-log.txt pip.py PKG-INFO regen-docs scripts setup.cfg setup.py tests
anant$ python pip.py --help Usage: pip.py COMMAND [OPTIONS] Options: --version show program's version number and exit -h, --help show this help message and exit -E DIR, --environment=DIR virtualenv environment to run pip in (either give the interpreter or the environment base directory) -v, --verbose Give more output -q, --quiet Give less output --log=FILENAME Log file where a complete (maximum verbosity) record will be kept --proxy=PROXY Specify a proxy in the form user:[email protected]:port. Note that the user:[email protected] is optional and required only if you are behind an authenticated proxy. If you provide [email protected]:port then you will be prompted for a password. --timeout=SECONDS Set the socket timeout (default 15 seconds)
Here’s a minimal set of instructions for upgrading to Python 3 using MacPorts:
sudo port install py37-pip sudo port select --set pip pip37 sudo port select --set pip3 pip37 sudo pip install numpy, scipy, matplotlib
I ran some old code and it works again after this upgrade.
Followed the advise on this URL, to rename the python39._pth file. That solved the issue
ren python39._pth python39._pth.save
I just needed to replace
pip3 so I ended up running the command as follows:
pip3 install matplotlib
I had a similar problem with
virtualenv that had
python3.8 while installing dependencies from
requirements.txt file. I managed to get it to work by activating the
virtualenv and then running the command
python -m pip install -r requirements.txt and it worked.