I spent most of the day yesterday searching for a clear answer for installing pip (package manager for Python). I can't find a good solution.
How do I install it?
Join Stack Overflow to learn, share knowledge, and build your career.
|
|
|
All you need to do is
|
|||||||||||||||||||||
|
|
You can install it through Homebrew on OS X. Why would you install Python with Homebrew?
Homebrew is something of a package manager for OS X. Find more details on the Homebrew page. Once Homebrew is installed, run the following to install the latest Python, Pip & Setuptools:
|
|||||||||||||||||||||
|
All you have to do is:
Details:
MacOS comes with
If this command returns a version number that means ℹ️ Now, all you have to do is run the following command.
After that, Let me know if you have any problems installing Complimentary GIF. Cheers! P.S. I ended up blogging a post about it. QuickTip: How Do I Install pip on macOS or OS X? |
|||||||||||||||||||||
|
|
On Mac:
|
|||||||||||||||||||||
|
|
I'm surprised no-one has mentioned this - since 2013, python itself is capable of installing
Works in pretty much the same way as |
|||||||||||||||||
|
|
When prompted for a password enter your normal login password. note: this works for other python packages too |
|||||||||||||||||
|
|
The simplest solution is to follow the installation instruction from pip's home site. Basically, this consists in:
The main advantage of that solution is that it install pip for the python version that has been used to run Most solutions that use a package manager (homebrew or macport) on OS X create a redundant installation of python in the environment of the package manager which can create inconsistencies in your system since, depending on what you are doing, you may call one installation of python instead of another. |
|||||||||||||||||||||
|
|
Installing a separate copy of Python is a popular option, even though Python already comes with MacOS. You take on the responsibility to make sure you're using the copy of Python you intend. But, the benefits are having the latest Python release and some protection from hosing your system if things go badly wrong. To install Python using HomeBrew:
Now confirm that we're working with our newly installed Python:
...should show a symbolic link to a path with "Cellar" in it like:
Pip should be installed along with Python. You might want to upgrade it by typing:
Now you're ready to install any of the 50,000+ packages on PyPI. Other NotesFormerly, I've used get-pip.py to install pip. But, the docs warn that get-pip.py does not coordinate with package managers and may leave your system in an inconsistent state. Anyway, there's no need, given that pip is now included with Python as of 2.7.9. Note that pip isn't the only package manager for Python. There's also easy_install. It's no good to mix the two, so don't do it. Finally, if you have both Python 2 and 3 installed, pip will point to whichever Python you installed last. Get in the habit of explicitly using either pip2 or pip3, so you're sure which Python is getting the new library. Happy hacking! |
|||||
|
|
NEW 2016 December: This worked for me on OS X v10.11 (El Capitan): Mac comes with Requirements
Steps:
With this I got these errors (but I've solved them in step 3): The directory The directory
Finally you can install an app like:
UPDATE: If you install
You need only to upgrade pip, but before that you need create a virtual environment to work with Python 3. You can use a project folder or any folder:
Check the versions:
To deactivate the environment:
|
|||||||||||||||||
|
|
You should install Brew first:
Then brew install Python
Then |
|||||||||
|
|
Download this file: get-pip.py Then simply type
Make sure you are on the same directory as get-pip.py or you supply the correct path for that file. For details, you can visit: http://pip.readthedocs.org/en/latest/installing.html or, http://thegauraw.tumblr.com/post/47601704154/how-to-install-pip-in-both-windows-ubuntu-easiest-way |
|||
|
|
Then update your PATH to include py27-pip bin directory (you can add this in ~/.bash_profile PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin:$PATH pip will be available in new terminal window. |
|||||||||
|
|
If you want "pip3" you can do the ff:
then you can execute
|
|||
|
|
|
To install or upgrade pip, download get-pip.py from http://www.pip-installer.org/en/latest/installing.html Then run the following:
For example:
|
|||||||||
|
|
Download python setup tools from the below website: https://pypi.python.org/pypi/setuptools Use the tar file. Once you download, go to the downloaded folder and run
Once you do that,you will have easy_install. Use the below then to install pip:
|
|||
|
|
|
Install python3 first, then use pip3 to install packages.
python3 will be installed, and pip is shipped with it. To use pip to install some package, run the following
Notice it's pip3 because you want to use python3. |
||||
|
|
|
For those who has both python2 & python3 installed, here's the solution:
|
|||||
|
|
Somehow easy install doesn't work on my old mac (10.8). This solve my problem.
If you do not have wget, just open in browser |
|||
|
|
|
On the recent version (from Yosemite or El Capitan I believe... at least from Sierra onward), you need to run So,
|
|||||||||||||
|
|
all these answers make use of Instead install pip in your /usr/local folder like this:
and then:
|
|||||
|
|
I recommend Anaconda to you. It`s the leading open data science platform powered by Python. There are many basic packages installed. |
|||||||||||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?