[Python.NET] ImportError: No module named Please help

Denis Akhiyarov denis.akhiyarov at gmail.com
Wed Dec 31 20:18:47 CET 2014


I recommend using Assembly Binding Log Viewer (fuslogvw.exe) for
corresponding .NET framework to see the log files of loading assemblies.

Set Log Location as Custom and in Settings point to your assemblies folder.
The log should show the sequence of DLLs being loaded and any errors.

This worked for me, see here:

http://stackoverflow.com/questions/4469929/could-not-load-file-or-assembly-or-one-of-its-dependencies
http://stackoverflow.com/questions/1674279/cant-locate-fuslogvw-exe-on-my-machine

On Wed, Dec 31, 2014 at 12:10 PM, Zane D. Purvis <zane.purvis at gmail.com>
wrote:

> I've seen something at least similar to this when the DLL I'm trying to
> use references a type in another DLL. When I copied that other DLL to the
> same location, it worked fine.
>
> In this situation, equivalent code in C# worked fine without the other
> DLL, but Python gave an error similar to what you are seeing. It does this
> even if the type I'm importing doesn't reference the type that can't be
> found: any reference in the assembly to an unfound type causes it.
>
> For me, an unrelated class in the assembly was using a JSON attribute, and
> I just needed to put the JSON DLL in the same directory. I could tell from
> looking at the commit logs of the .NET project what had changed, and was
> able to figure out what to do. I couldn't find a way through Python to tell
> what had failed. I wonder if Python.NET could be modified to either not
> require all types to be resolved even if they are not necessary or if it
> could at least identify the missing type.
>
>
> On Dec 31, 2014, at 12:44 PM, Murali CS <muraliright at gmail.com> wrote:
>
> Hi,
> We are using Python for .Net to create an API.
> C# Assembly is called by Python script to access API methods.
>
> 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
>
> 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?
>
> Could this be a dependency issue? I tried code decompile to compare old
> dlls and new ones.
> Couldn't find anything unusual.
>
> I am using Python27
>
> Your help is deeply appreciated.
>
> Thanks,
> Murali
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> https://mail.python.org/mailman/listinfo/pythondotnet
>
>
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> https://mail.python.org/mailman/listinfo/pythondotnet
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20141231/335c7f7c/attachment-0001.html>


More information about the PythonDotNet mailing list