开发者

How do I fix there is no such module error in python 2.6?

I've been using python 2.7 and after installation of python 2.7. All of the scripts have run successfully, but suddenly today, when I run python, it is recognized开发者_如何学Python with python 2.6, so for one of the python packages I get the following error:

/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python: 
No module named htseq-count

i am not sure why it happens. The path environment variable for python is set to:

PATH="/Library/Frameworks/Python.framework/Versions/2.7/Resources/bin:${PATH}" export PATH

How do I fix this error?


If your code relies on a particular version of Python, you should specify python2.7 or python2.6 instead of just python.

If this "suddenly" happened it's possible that installing some other software modified your $PATH so that the old version of Python now has priority (it's possible for multiple versions to be on your $PATH; it uses the first one it finds).

If you move these two lines to the bottom of the file they're in (maybe ~/.profile) it may correct this.

PATH="/Library/Frameworks/Python.framework/Versions/2.7/Resources/bin:${PATH}"
export PATH

You can type which python in Terminal you can see what binary it finds when looking for python on your $PATH.

If you don't mind using Python 2.6, you can probably install the missing package by typing this in your terminal:

easy_install-2.6 htseq


I think you are applying different python version to be used.

type

which python

under your control.

see which python you are using, you should config the one using python 2.7

python --version
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜