开发者

Some problem with postgres_psycopg2

Last night I upgraded my machine to Ubuntu 10.04 from 9.10.

It seems to have cluttered my python module. Whe开发者_Go百科never I run python manage.py I get this error:

ImportError: No module named postgresql_psycopg2.base

Can any one throw any light on this?


Couple of things. I ran into the same kind of error - but for a different thing (ie. "ImportError: No module named django") when I reinstalled some software. Essentially, it messed up my Python paths.

So, you're issue is very reminiscent of the one I had. The issue for me ended up being that the installed I used altered my .profile file (.bash_profile on some systems) in my home directory that messed up the Path environment variable to point to the incorrect Python binaries. This includes, of course, pointing to the wrong site-packages (where many Python extensions are installed).

To verify this, I used two Linux shell commands that saved the day for me where: "which python" and "whereis python"

The first tells you which version of Python you are running, and the second tells you where it is located. This is important since you can have multiple versions of Python installed on your machine.

Hopefully, this is will help you troubleshoot your issue. You may also want to try "$echo Path" (at the command line / terminal) to see where the paths to resolve commands.

You can fix your issue either by: 1- fixing your Path variable, and exporting Path, in .profile (or .bash_profile) 2- creating a sym link to the appropriate Python binary

Good luck :)

~Aki


You probably have inadvertently upgraded which version of python you're running. This means that your site-packages has likely moved, meaning you will need to reinstall them. Take a look at your python version:

$ python --version
Python 2.5.1

Once you have this, try re-installing your modules with either apt-get or easy_install.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜