擅长:python、mysql、java
<p>您可以将目录添加到<code>sys.path</code>列表中</p>
<pre><code>import sys
biopythondir = '/where/you/put/biopython'
if biopythondir not in sys.path:
sys.path.append(biopythondir)
# import seq
</code></pre>
<p>或者,要获得比使用环境变量和<code>sys.path</code>更优雅的解决方案,请参见<a href="http://docs.python.org/library/site.html#module-site" rel="nofollow">how to use .pth files to extend sys.path</a>。</p>