擅长:python、mysql、java
<p>在Unix系统上,它应该转换成/usr/local/lib/python**其中**是python版本…比如2.7等等。。。</p>
<p>你的答案实际上在于PYTHONPATH和PYTHONHOME变量的定义。</p>
<p><a href="http://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME" rel="nofollow">http://docs.python.org/2/using/cmdline.html#envvar-PYTHONHOME</a></p>
<p>默认搜索路径依赖于安装,但通常以前缀/lib/pythonversion开头(请参阅上面的PYTHONHOME)。它总是附加在Python身上。</p>
<p>我建议你也试试这个</p>
<pre><code>import sys
sys.path.append('Directory you wanna add to the path')
</code></pre>
<p>希望这有帮助。</p>