[Qgis-user] Error of import qgis.core in PyCharme or PyScripter

Marc Yeranosyan marc.yeranosyan at gmail.com
Wed Dec 16 02:00:24 PST 2020


Hi Richard,

Thanks for quick reply.

You are right, I forget the python doesn't like spaces. Thanks for url, I
will try it.

Marc

Le mer. 16 déc. 2020 à 10:50, Richard Duivenvoorde <rdmailings at duif.net> a
écrit :

> Hi Marc,
>
> Did you use
> https://qtibia.com/how-to-setup-pycharm-for-qgis-development-under-linux-and-windows/
> to try out?
>
> Another, is it possible that the space(s) in you path's maybe create havoc?
> In my java-time I always installed everything in 'programs' instead of
> 'Program Files', just because a lot of command line tools do not like that
> space...
>
> Regards,
>
> Richard Duivenvoorde
>
> On 12/16/20 10:25 AM, Marc Yeranosyan wrote:
> > Hi liste,
> >
> > I always had a problem with the integration of PyQgis libraries in
> PyScripter et PyCharme.
> > My lunch *PyCharme.bat* file to execute is:
> > @echo off
> > call "C:\Program Files\QGIS 3.16"\bin\o4w_env.bat
> > call "C:\Program Files\QGIS 3.16"\apps\grass\grass78\etc\env.bat
> > @echo off
> > path %PATH%;C:\Program Files\QGIS 3.16\apps\qgis\bin
> > path %PATH%;C:\Program Files\QGIS 3.16\apps\grass\grass78\lib
> > path %PATH%;C:\Program Files\QGIS 3.16\apps\Qt5\bin
> > path %PATH%;C:\Program Files\QGIS 3.16\apps\Python37\Scripts
> > set PYTHONPATH=%PYTHONPATH%;C:\Program Files\QGIS 3.16\apps\qgis\python
> > set PYTHONPATH=%PYTHONPATH%;C:\Program Files\QGIS
> 3.16\apps\Python37\lib\site-packages
> > set QGIS_PREFIX_PATH=C:\Program Files\QGIS 3.16\apps\qgis
> > set PYTHONHOME=C:\Program Files\QGIS 3.16\apps\Python37
> > set PATH C:\Program Files\JetBrains\PyCharm Community Edition
> 2020.3\bin;%PATH%
> > start "PyCharm aware of Quantum GIS" /B "C:\Program
> Files\JetBrains\PyCharm Community Edition 2020.3\bin\pycharm64.exe"%*
> >
> > But I have the same error while calling qgis.core or qgis._core. The
> image is below.
> >
> > /Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64
> bit (AMD64)] on win32
> > import qgis
> > import qgis._core
> > Traceback (most recent call last):
> >   File "<input>", line 1, in <module>
> >   File "C:\Program Files\JetBrains\PyCharm Community Edition
> 2020.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py",
> line 21, in do_import
> >     module = self._system_import(name, *args, **kwargs)
> > ImportError: DLL load failed: La procédure spécifiée est introuvable.
> > import qgis.core
> > Traceback (most recent call last):
> >   File "<input>", line 1, in <module>
> >   File "C:\Program Files\JetBrains\PyCharm Community Edition
> 2020.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py",
> line 21, in do_import
> >     module = self._system_import(name, *args, **kwargs)
> >   File "C:\Program Files\QGIS
> 3.16\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
> >     from qgis._core import *
> >   File "C:\Program Files\JetBrains\PyCharm Community Edition
> 2020.3\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py",
> line 21, in do_import
> >     module = self._system_import(name, *args, **kwargs)
> > ImportError: DLL load failed: La procédure spécifiée est introuvable./
> >
> > PyCharm et PyScripter has the same results outputs.
> > Could it be the reason for using *Windows 10 Pro* in place of *Windows
> Famillie*?
> > Thank you in advance
> > Marc
> >
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201216/0ea91582/attachment.html>


More information about the Qgis-user mailing list