All of this should work on Mac OS X 10.7 and 10.8. Install Xcode. Click preferences. On the window that pops up, go to the Downloads tab. Find 'command lines tools' and click the install button. Open Terminal. There are a few package managers that are specific to Python, and pip is the preferred one. Pip is a tool for easily installing and managing Python packages, that is recommended over easy_install. It is superior to easy_install in several ways, and is actively maintained. $ pip2 -V # pip pointing to the Homebrew installed Python 2 interpreter $ pip -V # pip pointing to the Homebrew installed Python 3 interpreter (if installed). Be cautious if you are using a Python install that is managed by your operating system or another package manager. Get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state.
Pip (recursive acronym for 'Pip Installs Packages' or 'Pip Installs Python') is a cross-platform package manager for installing and managing Python packages (which can be found in the Python Package Index (PyPI)) that comes with Python 2 >=2.7.9 or Python 3 >=3.4 binaries that are downloaded from python.org.
Suggested Read:How to Install Latest Python 3.6 Version in Linux
In this article, we will explain how to install PIP on mainstream Linux distributions.
Note: We will run all commands as the root user, if you are managing your system as a normal user, then use the sudo command to get root privileges or you can as well configure your system to run sudo command without entering a password, it's possible. Try it out!
Install PIP in Linux Systems
To install pip in Linux, run the appropriate command for your distribution as follows:
Install PIP On Debian/Ubuntu
Install PIP On CentOS and RHEL
Unluckily, pip is not packaged in official software repositories of CentOS/RHEL. So you need to enable the EPEL repository and then install it like this.
Install PIP on Fedora
Install PIP on Arch Linux
Install PIP on openSUSE
How to Use PIP in Linux Systems
To install, uninstall or search new packages, use these commands.
To see a list of all commands type:
Sample Output
You may also like to read these following related articles about Python.
In this article, we showed you how to install PIP on mainstream Linux distributions. To ask any questions relating to this topic, please take advantage of the feedback form below.
OS X (Mavericks) has Python 2.7 stock installed. But I do all my own personal Python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial
again. I can do it the way I've done it before, which is:
- Download pyserial from pypi
- untar pyserial.tgz
- cd pyserial
python3 setup.py install
But I'd like to do like the cool kids do, and just do something like pip3 install pyserial
. But it's not clear how I get to that point. And just that point. Not interested (unless I have to be) in virtualenv yet.
12 Answers
UPDATE: This is no longer necessary with Python3.4. It installs pip3 as part of the stock install.
I ended up posting this same question on the python mailing list, and got the following answer:
Which solved my question perfectly. After adding the following for my own:
So that I could run pip directly, I was able to:
or:
Travis GriggsTravis GriggsI had to go through this process myself and chose a different way that I think is better in the long run.
I installed homebrew
then:
The last step gives you some warnings and errors that you have to resolve. One of those will be to download and install the Mac OS X command-line tools.
then:
This gave me python3
and pip3
in my path.
Install Python3 on mac
Use pip3
to install modules
:)
Plus:when you install requests with python3, the command is:
not
To install, uninstall or search new packages, use these commands.
To see a list of all commands type:
Sample Output
You may also like to read these following related articles about Python.
In this article, we showed you how to install PIP on mainstream Linux distributions. To ask any questions relating to this topic, please take advantage of the feedback form below.
OS X (Mavericks) has Python 2.7 stock installed. But I do all my own personal Python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial
again. I can do it the way I've done it before, which is:
- Download pyserial from pypi
- untar pyserial.tgz
- cd pyserial
python3 setup.py install
But I'd like to do like the cool kids do, and just do something like pip3 install pyserial
. But it's not clear how I get to that point. And just that point. Not interested (unless I have to be) in virtualenv yet.
12 Answers
UPDATE: This is no longer necessary with Python3.4. It installs pip3 as part of the stock install.
I ended up posting this same question on the python mailing list, and got the following answer:
Which solved my question perfectly. After adding the following for my own:
So that I could run pip directly, I was able to:
or:
Travis GriggsTravis GriggsI had to go through this process myself and chose a different way that I think is better in the long run.
I installed homebrew
then:
The last step gives you some warnings and errors that you have to resolve. One of those will be to download and install the Mac OS X command-line tools.
then:
This gave me python3
and pip3
in my path.
Install Python3 on mac
Use pip3
to install modules
:)
Plus:when you install requests with python3, the command is:
not
brew install python3
create alias in your shell profile
- eg.
alias pip3='python3 -m pip'
in my.zshrc
- eg.
➜ ~ pip3 --version
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
northtreenorthtreeTo use Python EasyInstall (which is what I think you're wanting to use), is super easy!
so then with pip to install Pyserial you would do:
l'L'll'L'lAlso, it's worth to mention that Max OSX/macOS users can just use Homebrew to install pip3.
LiyaliLiyalipip
is installed automatically with python2 using brew:
brew install python3
pip3 --version
On Mac OS X Mojave
python
stands for python of version 2.7 and python3
for python of version 3. The same is pip
and pip3
. So, to upgrade pip
for python 3
do this:
On MacOS 10.12
download pip: pip as get-pip.py
download python3: python3
- install python3
- open terminal:
python3 get-pip.py
pip3
is available
Here is my simple solution:
If you have python2 and python3 both installed in your system, the pip upgrade will point to python2 by default. Hence, we must specify the version of python(python3) and use the below command:
This command will uninstall the previously installed pip and install the new version- upgrading your pip.
This will save memory and declutter your system.
For a fresh new Mac, you need to follow below steps:-
- Make sure you have installed
Xcode
sudo easy_install pip
/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'
brew doctor
brew doctor
brew install python3
And you are done, just type python3
on terminal and you will see python 3 installed.