我正在使用venv安装PyPI上比根环境中可用的
然而,使用解释器会给我返回根环境的版本。
为什么会出现这种情况,我该如何解决?
我的sys.path很乱,我不知道该如何清理它(我以前升级过Canopy发行版),但是这里有它的内容:
elpy
包更新的版本。从pip
查询,我看到elpy
的以下版本:~/python/standalone $ pip show elpy
---
Name: elpy
Version: 1.4.2
Location: /home/wdkrnls/python/env/local/lib/python2.7/site-packages
Requires: flake8
然而,使用解释器会给我返回根环境的版本。
In [4]: import elpy
In [5]: elpy.__version__
Out[5]: '1.3.0'
In [6]: ?elpy
Type: module
String Form:<module 'elpy' from '/home/ipython/Enthought2/lib/python2.7/site-packages/elpy/__init__.pyc'>
File: /home/ipython/Enthought/lib/python2.7/site-packages/elpy/__init__.py
Docstring:
The Emacs Lisp Python Environment.
为什么会出现这种情况,我该如何解决?
我的sys.path很乱,我不知道该如何清理它(我以前升级过Canopy发行版),但是这里有它的内容:
['',
'/home/wdkrnls/python/env/local/bin',
'/home/wdkrnls/python/env/local/lib/python2.7/site-packages/jediepcserver-0.0.0-py2.7.egg',
'/home/wdkrnls/python/env/local/lib/python2.7/site-packages/epc-0.0.5-py2.7.egg',
'/home/wdkrnls/python/env/local/lib/python2.7/site-packages/sexpdata-0.0.3-py2.7.egg',
'/home/ipython/Enthought2/lib/python2.7/site-packages/PyCifRW-3.3-py2.7-linux-x86_64.egg',
'/home/ipython/Enthought2/lib/python2.7/site-packages/graphtool-0.5.2-py2.7.egg',
'/home/ipython/Enthought2/lib/python2.7/site-packages',
'/home/wdkrnls/python/env/local/lib/python2.7/site-packages/argparse-1.2.1-py2.7.egg',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/site-packages',
'/home/ipython/Enthought/Canopy_64bit/User/lib/python2.7/site-packages',
'/home/wdkrnls/python/packages',
'/home/wdkrnls/python/standalone',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python27.zip',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/plat-linux2',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/lib-tk',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/lib-old',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/lib-dynload',
'/home/wdkrnls/python/env/local/lib/python2.7/site-packages',
'/home/ipython/Enthought2/lib/python2.7/site-packages/PIL',
'/home/ipython/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/PIL',
'/share/apps/python/Canopy/appdata/canopy-1.3.0.1715.rh5-x86_64/lib/python2.7/site-packages/IPython/extensions',
'/home/wdkrnls/python/packages',
'/home/wdkrnls/python/standalone']
我该如何维护 sys.path
?对于 Canopy 发行版,我是否需要所有这些 .egg 文件?