我有一个旧版本的 Python。然后我卸载了旧版本,并安装了一个新版本 - 2.7.9。
我将 2.7.9 设置为我的全局版本,pyenv
但我的所有模块都没有被检测到。它们是在升级之前安装的。现在我卸载它们并重新安装但仍然无法正常工作......
~/Projects/development$ python
Python 2.7.9 (default, Mar 3 2016, 16:42:45)
[GCC 4.6.3] on linux2
>>> from github import Github
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named github
他们已经在 python 升级后重新安装了!尝试再次安装它们,会给出Requirement 已经满足的错误。
~/Projects/development$ pip install PyGithub
Requirement already satisfied (use --upgrade to upgrade): PyGithub in /usr/local/lib/python2.7/dist-packages
Cleaning up...
我能做些什么?
~/Projects/development$ pyenv versions
system
* 2.7.9 (set by /home/user/.pyenv/version)
~/Projects/development$ python
Python 2.7.9 (default, Mar 3 2016, 16:42:45)
[GCC 4.6.3] on linux2
>>> sys.executable
'/usr/local/bin/python'
>>> sys.exec_prefix
'/usr/local'
>>> print '\n'.join(sys.path)
/usr/local/lib/python27.zip
/usr/local/lib/python2.7
/usr/local/lib/python2.7/plat-linux2
/usr/local/lib/python2.7/lib-tk
/usr/local/lib/python2.7/lib-old
/usr/local/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/site-packages
which pip
给/usr/bin/pip
.