2

I need to create a Qgis python script called by IronPython for application purpose. I've already read Using PyQGIS in standalone scripts & Running application of Qgis Cookbook (https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html).

After set environment path & run my script, it gave me an error :

IronPython.Runtime.Exceptions.ImportException : 'No module named qgis.core'

IronPython.Runtime.Exceptions.ImportException HResult=0x80131500
Message=No module named qgis.core Source=Microsoft.Dynamic
Arborescence des appels de procédure : à Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow(Object value) à IronPython.Runtime.Operations.PythonOps.ImportStar(CodeContext context, String fullName, Int32 level) à Microsoft.Scripting.Interpreter.ActionCallInstruction`3.Run(InterpretedFrame frame) à Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) à Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) à IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) à IronPython.Compiler.PythonScriptCode.Run(Scope scope) à IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope) à IronPython.Compiler.RuntimeScriptCode.Run(Scope scope) à Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) à Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
à Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(String path, ScriptScope scope) à LivrableChecker.Checker.FileDepencyChecker.QGISChecker() dans C:\Users\BVCS5568\Desktop\Livrable Checker\3 - Source code\LivrableChecker\LivrableChecker\Core\Checker\FileDepencyChecker.cs :ligne 141 à ConsoleApp1.Program.Main(String[] args) dans C:\Users\BVCS5568\Desktop\Livrable Checker\3 - Source code\LivrableChecker\ConsoleApp1\Program.cs :ligne 71

Utilities: Ironpython 2.7, Qgis 3.0, Visual Studio

Here is my code For C# call and Python script:

https://pastebin.com/FpnncwSj

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.