[Python] from qgis._core import * //ImportError: DLL load failed while importing _core: The...

Discussão em 'Python' iniciado por Stack, Maio 18, 2025.

  1. Stack

    Stack Membro Participativo

    How do I fix this error? I tried all the solutions given on other pages where similar errors were posted.

    My Python version: 3.9.13, Anaconda: 23.1.0, QGIS: 3.28.2, WINDOWS 10 X64

    My error:

    PS C:\Users\samudra.nayak\Downloads\qgis-temporal-profile-master> & C:/Users/samudra.nayak/Anaconda3/python.exe c:/Users/samudra.nayak/Downloads/qgis-temporal-profile-master/temporalprofileplugin.py
    Traceback (most recent call last):
    File "c:\Users\samudra.nayak\Downloads\qgis-temporal-profile-master\temporalprofileplugin.py", line 43, in <module>
    from qgis.core import QgsProject, QgsPointXY, QgsGeometry, QgsWkbTypes
    File "C:\Program Files\QGIS 3.28.2\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
    from qgis._core import *
    ImportError: DLL load failed while importing _core: The specified procedure could not be found.


    My environment variables:

    PATH

    C:\Users\samudra.nayak\Anaconda3;
    C:\Users\samudra.nayak\Anaconda3\Library\mingww64\bin;
    C:\Users\samudra.nayak\Anaconda3\Library\usr\bin;
    C:\Users\samudra.nayak\Anaconda3\Library\bin;
    C:\Users\samudra.nayak\Anaconda3\condabin;
    C:\Users\samudra.nayak\Anaconda3\Lib\site-packages;
    C:\Users\samudra.nayak\Anaconda3\Scripts;
    C:\Program Files\QGIS 3.28.2\apps\qgis\bin;
    C:\Program Files\QGIS 3.28.2\bin;
    %USERPROFILE%\AppData\Local\Microsoft\WindowsApps;
    C:\Users\samudra.nayak\AppData\Local\Programs\Microsoft VS Code\bin;
    C:\Program Files\QGIS 3.28.2\apps\grass\grass78\lib;
    C:\Program Files\QGIS 3.28.2\apps\Qt5\bin;
    C:\Program Files\QGIS 3.28.0\apps\Python39\Scripts;
    C:\\Users\\samudra.nayak\\Anaconda3\\DLLs;


    PYTHONPATH

    C:\Program Files\QGIS 3.28.2\apps\Python39;
    C:\Program Files\QGIS 3.28.2\apps\qgis\python;
    C:\Program Files\QGIS 3.28.2\apps\qgis\python\qgis;


    I need someone to tell me how to setup my environment and IDE to import the qgis.core library.

    I have tried the following to get the path on the qgis python terminal. I pasted the path onto PATH and PYTHONPATH but it just gave more errors.

    import sys
    print (sys.path)


    I tried these too: https://stackoverflow.com/a/67437837/15222441, https://stackoverflow.com/a/73666691/15222441, https://stackoverflow.com/a/41376679/15222441

    Continue reading...

Compartilhe esta Página