Re: [Qgis-user] ubuntu 8.04 and python bindings
On Wed, May 21, 2008 at 8:57 AM, Michele Ferretto <[EMAIL PROTECTED]> wrote: > ls /usr/share/qgis/python > plugins qgis and contents of /usr/share/qgis/python/qgis? :-) > ls /usr/share/qgis/python > doc grass i18n images python resources svg themes That's contents of /usr/share/qgis, isn't it? > print sys.path > ['', '/usr/share/qgis', '/usr/lib/python25.zip', '/usr/lib/python2.5', > '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', > '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', > '/usr/lib/python2.5/site-packages', > '/usr/lib/python2.5/site-packages/Numeric', > '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5', > '/var/lib/python-support/python2.5/gtk-2.0', > '/var/lib/python-support/python2.5/HTMLgen'] This is after doing "export PYTHONPATH=/usr/share/qgis" right? Martin ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] ubuntu 8.04 and python bindings
Martin Dobias wrote: On Wed, May 21, 2008 at 8:57 AM, Michele Ferretto <[EMAIL PROTECTED]> wrote: ls /usr/share/qgis/python plugins qgis and contents of /usr/share/qgis/python/qgis? :-) ls /usr/share/qgis/python/qgis/ __init__.pyc ls /usr/share/qgis/python doc grass i18n images python resources svg themes That's contents of /usr/share/qgis, isn't it? yes, sorry for the mistake. print sys.path ['', '/usr/share/qgis', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5', '/var/lib/python-support/python2.5/gtk-2.0', '/var/lib/python-support/python2.5/HTMLgen'] This is after doing "export PYTHONPATH=/usr/share/qgis" right? Yes. ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] ubuntu 8.04 and python bindings
On Wed, May 21, 2008 at 1:54 PM, Michele Ferretto <[EMAIL PROTECTED]> wrote: > Martin Dobias wrote: >> >> On Wed, May 21, 2008 at 8:57 AM, Michele Ferretto >> <[EMAIL PROTECTED]> wrote: >>> >>> ls /usr/share/qgis/python >>> plugins qgis >> >> and contents of /usr/share/qgis/python/qgis? :-) > > ls /usr/share/qgis/python/qgis/ > __init__.pyc So here's the problem - in that directory you should have also core.so and gui.so files which are python modules for QGIS. Please paste here the contents of the qgis package, you can do it like this: dpkg -L qgis 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 Martin ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] ubuntu 8.04 and python bindings
Martin Dobias wrote: ls /usr/share/qgis/python plugins qgis and contents of /usr/share/qgis/python/qgis? :-) ls /usr/share/qgis/python/qgis/ __init__.pyc So here's the problem - in that directory you should have also core.so and gui.so files which are python modules for QGIS. Please paste here the contents of the qgis package, you can do it like this: dpkg -L qgis 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? And...many thanks Martin! ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] ubuntu 8.04 and python bindings
On Wed, May 21, 2008 at 2:47 PM, Michele Ferretto <[EMAIL PROTECTED]> 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 ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user
Re: [Qgis-user] ubuntu 8.04 and python bindings
Great! Yes, the solution is removing the /usr/share/qgis/python/qgis directory and I think your hypothesis is absolutely correct! Many thanks! Martin Dobias wrote: 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 ___ Qgis-user mailing list Qgis-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-user