How to install pip for Python 3 on Mac OS X?

2020-01-24 06:09发布

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:

  1. Download pyserial from pypi
  2. untar pyserial.tgz
  3. cd pyserial
  4. 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.

14条回答
姐就是有狂的资本
2楼-- · 2020-01-24 06:35

Plus: when you install requests with python3, the command is:

pip3 install requests

not

pip install requests
查看更多
Viruses.
3楼-- · 2020-01-24 06:36

On MacOS 10.12

download pip: pip as get-pip.py

download python3: python3

  1. install python3
  2. open terminal: python3 get-pip.py
  3. pip3 is available
查看更多
该账号已被封号
4楼-- · 2020-01-24 06:38

To use Python EasyInstall (which is what I think you're wanting to use), is super easy!

sudo easy_install pip

so then with pip to install Pyserial you would do:

pip install pyserial
查看更多
ゆ 、 Hurt°
5楼-- · 2020-01-24 06:41

pip is installed automatically with python2 using brew:

  1. brew install python3
  2. pip3 --version
查看更多
你好瞎i
6楼-- · 2020-01-24 06:41

For a fresh new Mac, you need to follow below steps:-

  1. Make sure you have installed Xcode
  2. sudo easy_install pip
  3. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  4. brew doctor
  5. brew doctor
  6. brew install python3

And you are done, just type python3 on terminal and you will see python 3 installed.

查看更多
Summer. ? 凉城
7楼-- · 2020-01-24 06:49

Install Python3 on mac

1. brew install python3
2. curl https://bootstrap.pypa.io/get-pip.py | python3
3. python3

Use pip3 to install modules

1. pip3 install ipython
2. python3 -m IPython

:)

查看更多
登录 后发表回答