回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我已经安装了一些python包,我可以使用IDLE而不是通过command shell窗口访问它们。</p>
<p>以下是空闲时的输出:</p>
<pre><code>Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> import whoosh
</code></pre>
<p>这是我终端的输出:</p>
<pre><code>pradeep@ubuntu:~$ python
Python 2.7.2 (default, Nov 28 2011, 23:56:33)
[GCC 4.6.1] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> import whoosh
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named whoosh
</code></pre>
<p>如何将终端python指向空闲python包?为什么终端显示“linux3”,而空闲显示“linux2”?请帮助我解决这个路径问题。谢谢。</p>
<p><strong>更新1:</strong></p>
<p>谢谢大家。像你们大多数人猜测的那样,我已经安装了两个不同的版本。</p>
<p>我的空闲路径显示</p>
<pre><code>['/home/pradeep', '/usr/bin', '/usr/local/lib/python2.7/dist-packages/Whoosh-2.3.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol']
</code></pre>
<p>我的终端路径显示:</p>
<pre><code>['', '/usr/local/lib/python27.zip', '/usr/local/lib/python2.7', '/usr/local/lib/python2.7/plat-linux3', '/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']
</code></pre>
<p>如何删除终端版本并在终端中安装空闲版本?谢谢。</p>