我有两个感兴趣的 python 2.7:
- IDLE 版本来自https://www.python.org/downloads/ https://www.python.org/downloads/
- 蟒蛇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
update: Per 这个答案 https://stackoverflow.com/a/54811749/3904031我已经打开 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 https://rhodesmill.org/skyfield/installation.html我今天成功地将我的 anaconda 版本升级到1.10
using pip install --upgrade skyfield