[Qgis-user] ubuntu 8.04 and python bindings

Martin Dobias wonder.sk at gmail.com
Wed May 21 07:03:39 PDT 2008


On Wed, May 21, 2008 at 2:47 PM, Michele Ferretto
<michele.ferretto at tiscali.it> wrote:
>> But I'm wondering why importing the bindings doesn't fail if you set
>> python path to /usr/share/qgis. Maybe the python modules are installed
>> in /usr/lib/python2.5/site-packages or
>> /usr/local/lib/python2.5/site-packages. Can you check it? (they're
>> present if there's a subdirectory called "qgis" and it has several
>> files inside: __init__.py, core.so, gui.so
>>
>
> Yes! in /usr/lib/python2.5/site-packages/qgis there are all the files
> mentioned above; I copied these files in /usr/share/qgis/python/qgis/ just
> to try and now that's all right, I can use the python plugins.
>
> which is the path to change without having to copy the files?

I'm getting the idea what probably happened. There are two ways where
PyQGIS modules can be put. First possibility (default when compiling
from source) is that modules are put to
(prefix)/share/qgis/python/qgis path, second possibility (which is
more suitable for packagers) is that the modules are put to python's
site-packages directory (which is often used as place for custom
python modules).

I guess previously you have installed qgis 0.9.x (which supposedly
used first variant) and then installed qgis 0.10. For some reason (I
expect that once you've run qgis as root) python created __init__.pyc
in /usr/share/qgis/python/qgis so uninstall of qgis 0.9 didn't delete
this directory. Now, when qgis 0.10 finds this dir it thinks it
contains PyQGIS modules which are in fact present elsewhere (but this
directory has preference). Is my hypothesis correct? ;-)

Regarding the correction of your problem - the best way is to leave
contents of /usr/lib/python2.5/site-packages untouched and just delete
/usr/share/qgis/python/qgis directory as root. Please confirm if that
works for you.

Bye,
Martin



More information about the Qgis-user mailing list