我有两个感兴趣的 python 2.7:
我使用 MacOS。(我知道我早该切换到 Python 3)
我想申请pip install --upgrade PackageName
一个 IDLE 的 Python 使用的包,但是当我在终端中输入它时,它会尝试将它应用到我的 anaconda 版本。
有没有办法找到我的 IDLE 的 python,指向它,然后将pip
命令应用于它?
这是我所拥有的:
$ which python
/Users/david/anaconda2/bin/python
$ which -a python
/Users/david/anaconda2/bin/python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python
/usr/local/bin/python
/usr/bin/python
更新: 根据这个答案,我打开 IDLE 并输入
import sys
sys.executable
它回来了/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
。
然后我打开一个终端并输入/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -m pip install --upgrade skyfield
我收到了以下信息:
Cache entry deserialization failed, entry ignored
Could not fetch URL https://pypi.python.org/simple/skyfield/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Requirement already up-to-date: skyfield in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Could not fetch URL https://pypi.python.org/simple/jplephem/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Requirement already up-to-date: jplephem>=2.3 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from skyfield)
Could not fetch URL https://pypi.python.org/simple/sgp4/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Requirement already up-to-date: sgp4>=1.4 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from skyfield)
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
Requirement already up-to-date: numpy in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from skyfield)
我关闭 IDLE 然后重新打开它,然后输入
import skyfield
skyfield.__version__
仍然只是1.0
没有更新。
Skyfield 当前版本为1.10
https://rhodesmill.org/skyfield/installation.html,我今天成功升级了我的 anaconda 版本以1.10
使用pip install --upgrade skyfield