admin管理员组

文章数量:1122846

i have a geodjango project with python 12 and windows 11 i have install qgis software also

in my project settings for gdal path i have

try:
    # configure based on your env configuration
    print(os.name)
    if os.name == "nt":
        # os.environ['PATH'] = os.path.join(VIRTUAL_ENV_DIR, r'.\Lib\site-packages\osgeo') + ';' + os.environ['PATH']
        # os.environ['PROJ_LIB'] = os.path.join(VIRTUAL_ENV_DIR, r'.\Lib\site-packages\osgeo\data\proj') + ';' + os.environ['PATH']
        # GDAL_LIBRARY_PATH = os.path.join(VIRTUAL_ENV_DIR, r'.\Lib\site-packages\osgeo\gdal304.dll')
        os.environ["GDAL_LIBRARY_PATH"] = "C:\\Program Files\\QGIS 3.40.2\\bin\\gdal309.dll"
        os.environ["GEOS_LIBRARY_PATH"] = "C:\\Program Files\\QGIS 3.40.2\\bin\\geos_c.dll"
        GDAL_LIBRARY_PATH = "C:\\Program Files\\QGIS 3.40.2\\bin\\gdal309.dll"
        GEOS_LIBRARY_PATH = "C:\\Program Files\\QGIS 3.40.2\\bin\\geos_c.dll"
except:
    pass

The project runs in vscode but not with pycharm

it returns error

oserror(22, The specified procedure could not be found)
<CDLL 'C:\Program Files\QGIS 3.40.2\bin\gdal309.dll', handle 0 at 0x1cabd1bd570>

本文标签: geodjango with pycharm not works and windows 11Stack Overflow