[QGIS-Developer] import PyQt5.QtCore failed (from OSGeo4W python)

Nyall Dawson nyall.dawson at gmail.com
Mon Mar 4 14:52:44 PST 2019


On Tue, 5 Mar 2019 at 00:45, Idan Miara <idan at miara.com> wrote:
>
> Hi,
>
> I've used the OSGeo4W setup to install PyQt5 and then ran:
> import PyQt5.QtCore
> from a python shell (OSGeo4W.bat with qt5_env, py3_env inside)
> I'm getting the following error:
>
> D:\OSGeo4W64>python
> Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import PyQt5.QtCore
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> SystemError: initialization of QtCore failed without raising an exception
> >>>
>
> Running the same command in a QGIS python shell works fine (same batch file)
> Please advise.

You probably need to run:

py3_env.bat
qt5_env.bat

first. The osgeo4w command line defaults to python2/Qt4 compatibility
if you don't run those commands.

Nyall


>
> Kind regards,
> Idan
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list