• 欢迎订阅我的Youtube频道
  • 欢迎加入我的电报群

How to install modules dependencies/packages for Python on Mac

网络技术 fennng 1年前 (2018-07-22) 3017次浏览 1个评论

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.

[email protected]:~/GitLocal/seq2seq-attn > python -m pip install h5py
/usr/bin/python: No module named pip

installing pip through easy_install didn’t work either.

[email protected]:~/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


峰享技术 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:How to install modules dependencies/packages for Python on Mac
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. To make python2 work, I need to upgrade pip curl https://bootstrap.pypa.io/get-pip.py | sudo python
    fennng2018-07-24 07:40 Reply