2017-01-31 13 views
1

私のpythonインタープリタがこの特定のモジュールを読み込めません。次の例外がスローされます。IronPython.Modules.dllがロードされていません

Starting interpreter... 
Running file 'C:\Berkeley Lights\CellAnalysisSuite\Scripts\New Text Document.py' 
Traceback (most recent call last): 
    Line 2, in <module> 
IOError: System.IO.IOException: Could not add reference to assembly IronPython.Modules.dll 
    at IronPython.Runtime.ClrModule.AddReferenceToFile(CodeContext context, String file) 
    at IronPython.Runtime.ClrModule.AddReferenceToFile(CodeContext context, String[] files) 
    at Microsoft.Scripting.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) 
    at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) 
    at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3) 
    at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) 
    at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame) 
    at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) 
    at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1) 
    at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx) 
    at CellAnalysisSuite.Framework.Common.PythonInterpreter.RunThread() in C:\TFS\Branches\CellAnalysisSuite\Framework\Common\PythonInterpreter.cs:line 463 

、ここでは、 "新しいテキストDocument.py":

import clr 
clr.AddReferenceToFile("IronPython.Modules.dll") 

環境:

  • をWin10Pro
  • IronPythonの2.7
  • 。 NET 4.6.2
  • 通訳C#/ WinFormsアプリケーションから起動しました

答えて

1

この問題は、私たちのGUIで使用されているPythonインタプリタがローカルシステムにインストールされているインタプリタと同じではないことから確認されています。内部の開発者は、内部的に配布されたDLLになるようにライブラリの参照を切り替え、エンドユーザーがPythonを自分のシステムにインストールする必要性を減らしました。必要なモジュールがプロジェクトの内部から参照され、インポートがスクリプトから削除されると、上記のモジュールにアクセスできました。

関連する問題