Summary
Iâm trying to use pyqgis with Streamlit. For this, initially I have to import * from qgis.core - this fails with dll error. Iâm running streamlit with QGISâs included âpython-qgis.batâ, using â-m streamlit run myappâ. Path and Pythonpath seem to be unchanged by streamlit.
Steps to reproduce
Code snippet:
import streamlit as st
from qgis.core import *
Expected behavior:
I excpect qgis core modules to be loaded with from qgis.core import *.
Actual behavior:
I get the following error message:
ImportError: DLL load failed while importing _core: No se encontrĂł el proceso especificado.
Traceback:
File "C:\OSGeo4W\apps\Python39\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script
exec(code, module.__dict__)File "C:\Users\Tambet\eclipse-workspace\qgis test\strl1.py", line 15, in <module>
from qgis.core import *File "C:\OSGeo4W\apps\qgis\python\qgis\core\__init__.py", line 25, in <module>
from qgis._core import *
Debug info
- Streamlit version: 1.21.0
- Python version: 3.9.5
- OS version: Windows 10
- Browser version: Microsoft Edge versiĂłn 112.0.1722.48 (CompilaciĂłn oficial) (64 bits)
Requirements file
I use the environment included with QGIS advanced network installation, where you have to check to install python and python-tools (and pip to install streamlit). Then, use python-qgis.bat in osgeo4w bin directory, as a default python installation.