我想創建一個在選擇這個簡單的Python代碼上執行的快捷方式。 它只是從庫Biopython中運行一個函數。導入python庫gedit外部工具時出錯
#!/Users/USERNAME/Library/Enthought/Canopy_64bit/User/bin/python
from Bio.Seq import reverse_complement
import sys
print reverse_complement(sys.stdin.read().rstrip())
但我得到這個錯誤:
ImportError: No module named Bio.Seq
它沒有任何意義,我因爲如果我從終端
$ /Users/USERNAME/Library/Enthought/Canopy_64bit/User/bin/python
>>> from Bio.Seq import reverse_complement
圖書館是沒有任何問題的進口運行。 我做錯了什麼?我如何告訴gedit在哪裏尋找圖書館?
如果最後一條命令前加上'打印sys.executable',您能得到什麼? (*運行在終端*,*運行不在終端*) – falsetru
gedit: '/ Users/gioelelamanno/Library/Enthought/Canopy_64bit/User/Resources/Python.app/Contents/MacOS/Python' Terminal: '/ Users/gioelelamanno/Library/Enthought/Canopy_64bit/User/bin/python' – Gioelelm