简体   繁体   English

使用存储在网络中的Qgis运行Qgis独立应用程序

[英]Run a Qgis Standalone Application using Qgis stored at a Network

I have written a standalone application (in python) for QGis which should be used in my Company. 我已经为QGis编写了一个独立的应用程序(使用python),应在我的公司中使用。 The problem is, that it isn't useful if everyone has to Download Qgis etc. to make it run. 问题是,如果每个人都必须下载Qgis等使其运行,它就没有用。 So my idea was, to put Qgis on the network, because the application is only using some libraries. 所以我的想法是将Qgis放在网络上,因为该应用程序仅使用一些库。 I start the program with a batch file, with the directories connected to the network and I get exception saying that DLL load failed and is talking about the qgis.core library. 我使用一个批处理文件启动该程序,该文件具有连接到网络的目录,并且出现异常,提示DLL加载失败,并且正在谈论qgis.core库。

The Error of the Command Promt: 命令提示错误:

Traceback (most recent call last):
file "Y.\OSGeo4W64\CodesNetrtest\ExistingCCsrun.py", line 2 in (module)
from qgis.core import *
File "Y:\O52RC~F\apps\qgis\python\qgis\__init__.py", line 36, in (module)
from qgis.core import QgsFeature, QgsGeomtetry
File "Y:\O52RC~F\apps\qgis\python\qgis\core\__init__.py", line3, in (module)

from qgis._core import *

Import Error: DLL load failed: The declared modul has not been found.

The batch file I use looks like: 我使用的批处理文件如下所示:

@echo off
SET OSGEO4W_ROOT=Z:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.3\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;%OSGEO4W_ROOT%\apps\grass\grass-6.4.3\lib

set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python;
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\qgis
set PATH=Z:\Program Files (x86)\Git\cmd;Z:\Program Files (x86)\Vim\vim74;%PATH%
cd %HOMEPATH%\development
start "Python IDE aware of Quantum GIS" /B "Z:\OSGeo4W64\bin\python.exe" %*

"Z:\Users\Christian\Documents\Wirtschaftsingenieurwesen\SS15\Bachelorarbeit KNORR\PotentialanalyseCCS\Codes\ExistingCCSrun.py"

Could someone help me by saying what am I doing wrong, an if there even is a possibility to realise my idea? 有人可以通过说我在做错什么来帮助我,甚至有可能实现我的想法吗? Unfortunately I'm not a expert concerning those subjects. 不幸的是,我不是这些主题的专家。

Thanks in advance. 提前致谢。

Try this, I've changed order in the PATH and PYTHONPATH environment variables. 试试这个,我已经更改了PATH和PYTHONPATH环境变量的顺序。

@echo off
SET OSGEO4W_ROOT=Z:\OSGeo4W64
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-6.4.3\etc\env.bat
@echo off
path %OSGEO4W_ROOT%\apps\qgis\bin;%PATH%;
path %OSGEO4W_ROOT%\apps\grass\grass-6.4.3\lib;%PATH%;

set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis\python;%PYTHONPATH%;
set PYTHONPATH=%OSGEO4W_ROOT%\apps\Python27\Lib\site-packages;%PYTHONPATH%;
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\qgis
set PATH=Z:\Program Files (x86)\Git\cmd;Z:\Program Files (x86)\Vim\vim74;%PATH%
cd %HOMEPATH%\development
start "Python IDE aware of Quantum GIS" /B "Z:\OSGeo4W64\bin\python.exe" %*

"Z:\Users\Christian\Documents\Wirtschaftsingenieurwesen\SS15\Bachelorarbeit KNORR\PotentialanalyseCCS\Codes\ExistingCCSrun.py"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM