[Qgis-user] python import errors

José María Michia jose.maria.michia at gmail.com
Wed Nov 12 17:15:07 PST 2008


2008/11/12 Martin Dobias <wonder.sk at gmail.com>
>
> Hi,
>
> On Thu, Nov 13, 2008 at 12:39 AM, José María Michia
> <jose.maria.michia at gmail.com> wrote:
> > Hi,
> >
> > I've compiled QGIS 0.11 again, because I've updated Python to version 2.5.
> >
> > Now, when I go to a shell and execute qgis, I obtain some python errors:
> >
> > "An error occured during execution of following code:
> > import traceback
> > can't import cStringIO"
> >
> > "An error occured during execution of following code:
> >
> > import __main__
> > can't import cStringIO"
> >
> > "Couldn't load SIP module.
> > Python support will be disabled.
> > can't import cStringIO"
> >
> > After this messages, QGIS exits.
> >
> > In python shell, the imports mentioned in error messages work correctly:
> >
> > $ python
> >>>> import traceback
> >>>> import cStringIO
> >>>> import sip
> >>>>
> > Everything was functioning normally before upgrading Python. I suppose I
> > have to modify some system variable, like PYTHONPATH, but I can not find
> > which one.
> >
> > I'm using gentoo. Python 2.5 installed using emerge. The previous
> > installation of QGIS, that function correctly, compiled manually.
>
> there must be still some mismatch with your python versions...
> - do you have only one version of python installed or more? (check:
> equery l python)

I only have installed Python version 2.5 . I've deleted previous versions.

> - what version do you get if you run: python -v

Python 2.5.2 (r252, Oct 16 2008, 10:28:16)

> - what python version does libqgispython.so link to (using command ldd)

"ldd /usr/local/lib/libqgispython.so.0.11" does not show anything
resembling "libpython ..."

> - on gentoo there's a command python-updater. maybe there are some
> updates pending?

I've run python-updater, and the problem persists.

I have noticed that "/usr/local/lib/libqgispython.so.0.11" is out of
date. I deleted the older version of the file "/
usr/local/lib/libqgispython.so.0.11" (and also libqgisgrass) QGIS and
now works fine (without python and without grass, I guess).

I think QGIS has not been properly compiled. I remember a message on
ccmake said that "Python is not being built," but imagine that it was
not serious. Return to the compilation process and send a message with
this problem.

Thanks Martin
José María



More information about the Qgis-user mailing list