[英]Cannot import qgis package on python app?
I've a little issue on my python script.我的 python 脚本有一点问题。 I want to import qgis.core to use qgis function in my script but I can't import this package.
我想导入 qgis.core 以在我的脚本中使用 qgis function,但我无法导入这个 package。 I work on python virtual environment with python 3.7 and Qgis work with python 3.7 too.
我使用 python 3.7 和 Qgis 使用 python 3.7 在 python 虚拟环境中工作。 When I run
import qgis.core
I obtain this answer:当我运行
import qgis.core
我得到这个答案:
No module named 'qgis'
This is normal because I can't install it with conda/pip install.这是正常的,因为我无法使用 conda/pip install 安装它。 In my conda shell when I run
conda install qgis.core
, I have:在我运行
conda install qgis.core
时,在我的 conda shell 中,我有:
PackagesNotFoundError: The following packages are not available from current channels:
- qgis.core
Any idea to help me please?有什么想法可以帮助我吗? Thanks.
谢谢。
In anaconda prompt activate your_new_env (conda activate your_new_env)在 anaconda 提示激活 your_new_env (conda activate your_new_env)
Install qgis ( conda install -c conda-forge qgis)安装 qgis ( conda install -c conda-forge qgis)
Go to Anaconda Navigator, Choose your_new_env in Home Applications on: then open spyder. Go 到 Anaconda 导航器,在 Home Applications on 中选择 your_new_env:然后打开 spyder。 Open spyder.
打开间谍。
Try to import qgis尝试导入qgis
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.