问题描述
我们正在使用Python面向.NET调用.NET API使用内置的Python脚本C#。我们正在导入错误:没有模块命名 - 错误,当导入完成后如下:
We are using Python for .Net to call .NET API built using C# from Python script.We are getting ImportError: No module named - error when an import is done as follows.
Python脚本:
import sys
sys.path.append(r"C:\myfolderA\myfolderB")
print sys.path
import clr
clr.FindAssembly(r"AA.BB.CC")
clr.AddReference(r"AA.BB.CC")
from AA.BB.CC.Api.DDInterface import DDClient
在上面的行我收到以下错误
On the above line I am getting following error
Traceback (most recent call last):
File "C:\myfolderA\myfolderB\testAPI.py", line 7, in <module>
from AA.BB.CC.Api.DDInterface import DDClient
ImportError: No module named AA.BB.CC.Api.DDInterface
没有可用于准确识别问题的任何其他信息。从同一个项目中的Dll内置15天回到正常工作。该项目可以通过一些变化已经在两者之间。
There is no other information available to exactly identify the issue.Dlls from same project built 15 days back works fine.This project may have gone through few changes in between.
如何准确识别这个问题?
How to exactly identify this issue?
难道这是一个依赖的问题?我试图JustDecompile比较旧的DLL和新的,但没有发现什么异常。
Could this be a dependency issue?I tried JustDecompile to compare old dlls and new ones, but couldn't find anything unusual.
您的帮助深深地AP preciated。
Your help is deeply appreciated.
谢谢
推荐答案
从蟒蛇论坛帮助,我能够使用微软的Fuslogvw.exe(集绑定日志查看器),并计算出了相关的DLL导致错误。
With help from python forum I was able to use Microsoft's Fuslogvw.exe (Assembly Binding Log Viewer) and figure out the dependent dll causing the error.
感谢
这篇关于Python中的.NET错误:导入错误:没有模块命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!