昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期一, 七月 23, 2018

How to install modules dependencies/packages for Python on Mac

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


figure1



For me, python 2.7 doesn't have pip installed. Python3 works.


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


installing pip through easy_install didn't work either.

[bash]
fengnz@mac:~/GitLocal/seq2seq-attn > sudo easy_install pip
Password:
Sorry, try again.
Password:
Searching for pip
Download error on https://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)
Download error on https://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')
[/bash]


python3 -m pip install h5py


没有评论:

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.