Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't load PyQGIS. #21837

Closed
qgib opened this issue Nov 12, 2015 · 10 comments
Closed

Couldn't load PyQGIS. #21837

qgib opened this issue Nov 12, 2015 · 10 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Plugins

Comments

@qgib
Copy link
Contributor

qgib commented Nov 12, 2015

Author Name: Sandro Santilli (@strk)
Original Redmine Issue: 13812
Affected QGIS version: master
Redmine category:python_plugins


QGIS master fails to support Python on Ubuntu 14.04, raises this error on starting from the build dir:

Couldn't load PyQGIS.
Python support will be disabled.


getvalue() did not return a string

Python version:
2.7.6 (default, Jun 22 2015, 18:01:27) 
[GCC 4.8.2]

QGIS version:
2.13.0-Master 'Master', 6e1df49

Python path:
['/usr/src/qgis/build/master/output/python', u'/home/strk/.qgis2/python', u'/home/strk/.qgis2/python/plugins', '/usr/src/qgis/build/master/output/python/plugins', '/usr/local/lib/python2.7/dist-packages/nik2img-0.8.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/multicorn-1.0.3_dev-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/GDAL-1.11.0-py2.7-linux-x86_64.egg', '/usr/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/cartman-0.2.3-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

Note that 2.8 branch has no problems with python (when also started from build dir)

@qgib
Copy link
Contributor Author

qgib commented Nov 13, 2015

Author Name: Giovanni Manghi (@gioman)


no problems here on the same platform.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 13, 2015

Author Name: Sandro Santilli (@strk)


this was with commit 6e1df49 and the configuration script is:

DEB_BUILD_MULTIARCH=`dpkg-architecture -qDEB_BUILD_MULTIARCH` # returns x86_64-linux-gnu

cmake \\
  -D PYTHON_LIBRARY=/usr/lib/${DEB_BUILD_MULTIARCH}/libpython2.7.so \\
  -D CMAKE_BUILD_TYPE=Debug \\
  -D WITH_SERVER=ON \\
  -D WITH_STAGED_PLUGINS=ON \\
  -D ENABLE_TESTS=1 \\
  -D CMAKE_CXX_COMPILER:FILEPATH=/usr/lib/ccache/g++ \\
  -D WITH_ASTYLE=1 \\
  -D WITH_INTERNAL_QWTPOLAR=1

The build happens in a newly created dir.

@qgib
Copy link
Contributor Author

qgib commented Nov 13, 2015

Author Name: Giovanni Manghi (@gioman)


The build happens in a newly created dir.

I can compile but I usually don't. It works ok if you install master with the nightly repo.

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Sandro Santilli (@strk)


I'm still having this problem as of commit 8996be9
(December 2, 2015).

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Sandro Santilli (@strk)


Sorry, on a more careful read of the error, the message is now different:

Couldn't load PyQGIS.
Python support will be disabled.


Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/src/qgis/build/master/output/python/qgis/__init__.py", line 36, in 
    from qgis.core import QgsFeature, QgsGeometry
  File "/usr/src/qgis/build/master/output/python/qgis/core/__init__.py", line 9, in 
    from qgis._core import *
ImportError: No module named QtSql


Python version:
2.7.6 (default, Jun 22 2015, 18:01:27) 
[GCC 4.8.2]

QGIS version:
2.13.0-Master 'Master', 8996be9

Python path:
['/usr/src/qgis/build/master/output/python', u'/home/strk/.qgis2/python', u'/home/strk/.qgis2/python/plugins', '/usr/src/qgis/build/master/output/python/plugins', '/usr/local/lib/python2.7/dist-packages/nik2img-0.8.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/multicorn-1.0.3_dev-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/GDAL-1.11.0-py2.7-linux-x86_64.egg', '/usr/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages/cartman-0.2.3-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

Also happens after wiping out the ~/.qgis2 directory

Is QtSql a new dependency?

\cc @elpaso

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Sandro Santilli (@strk)


I find python3-pyqt4.qtsql and python3-pyqt5.qtsql packaged, but none for python 2.7, which I'm using.
Is python 2.7 still supposed to be supported by qgis-2.12 ?

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Sandro Santilli (@strk)


Both the db_manager and the processing plugins use the QtSql package.
No plugin did that in QGIS 2.8.

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Luigi Pirelli (@luipir)


Sandro Santilli wrote:

Both the db_manager and the processing plugins use the QtSql package.
No plugin did that in QGIS 2.8.

libqt4-sql
and
python-qt4-sql

@qgib
Copy link
Contributor Author

qgib commented Dec 2, 2015

Author Name: Sandro Santilli (@strk)


Installing python-qt4-sql fixed the issue, thanks Luigi Pirelli for the hint.
The getvalue() I cannot reproduce anymore so assuming fixed.


  • status_id was changed from Feedback to Closed
  • resolution was changed from to fixed/implemented

@qgib
Copy link
Contributor Author

qgib commented Jun 9, 2018

Author Name: Akkal Bist (Akkal Bist)


*Hello this is my error in ubuntu 18.04 and i am unable to install OpenLayerPlugin
*
@akkal@akkal-HP:~$ qgis
Warning: libpng warning: iCCP: known incorrect sRGB profile
Warning: libpng warning: iCCP: known incorrect sRGB profile
"<font color="red">Couldn't load PyQGIS.
Python support will be disabled.
```
Traceback (most recent call last):
  File "", line 1, in
ModuleNotFoundError: No module named 'qgis'

@

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Plugins labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Plugins
Projects
None yet
Development

No branches or pull requests

1 participant