How to install modules dependencies/packages for Python on Mac

  • fennng 

On my Mac OS EI Capitan, there are both python 2.7 and python 3 available. I don’t know whether there came from the OS or installed ages ago.

To install a new module, the following command can be used.

python -m pip install SomePackage

For me, python 2.7 doesn’t have pip installed.

fengnz@mac:~/GitLocal/seq2seq-attn > python -m pip install h5py
/usr/bin/python: No module named pip

installing pip through easy_install didn’t work either.

fengnz@mac:~/GitLocal/seq2seq-attn > sudo easy_install pip
Password:
Sorry, try again.
Password:
Searching for pip
Reading pypi.python.org/simple/pip/
Download error on pypi.python.org/simple/pip/: [SSL:
TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) --
Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading <a href="https://pypi.python.org/simple/">pypi.python.org/simple/</a>
Download error on pypi.python.org/simple/: [SSL:
TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) --
Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')

 

Python3 works.

python3 -m pip install h5py

《How to install modules dependencies/packages for Python on Mac》有1个想法

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注