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

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

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.

ベストアンサー1

UPDATE: This is no longer necessary as of Python3.4. pip3 is installed as part of the general Python3 installation.

結局、同じ質問を Python メーリング リストに投稿したところ、次のような回答が返ってきました。

# download and install setuptools
curl -O https://bootstrap.pypa.io/ez_setup.py
python3 ez_setup.py
# download and install pip
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py

これで私の質問は完璧に解決しました。私自身のために以下を追加した後:

cd /usr/local/bin
ln -s ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/pip pip

pip を直接実行できるようにするために、次の操作を実行できました。

# use pip to install
pip install pyserial

または:

# Don't want it?
pip uninstall pyserial

おすすめ記事