[Qgis-user] python import errors

Martin Dobias wonder.sk at gmail.com
Wed Nov 12 15:56:43 PST 2008


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)
- what version do you get if you run: python -v
- what python version does libqgispython.so link to (using command ldd)
- on gentoo there's a command python-updater. maybe there are some
updates pending?

Martin



More information about the Qgis-user mailing list