ModuleNotFoundError on import of namespace from custom dll
See original GitHub issueEnvironment
- Pythonnet version: 3.0.0.dev1
- Python version: Python 3.7.3
- Operating System: Debian (mcr.microsoft.com/dotnet/core/sdk:3.1-buster)
- .NET Runtime: Microsoft.AspNetCore.App 3.1.18
Details
-
Describe what you were trying to get done. Import a Namespace from a Custom (though not written by me) Assembly. I have confirmed that the namespace I try to import is correct, exists in the DLL, etc.
-
What commands did you run to trigger this issue? If you can provide a I invoke the python script with
python3 demo.py
# demo.py
import os
import sys
runtimeConfigPath = r'/usr/share/dotnet/shared/Microsoft.AspNetCore.App/3.1.18/Microsoft.AspNetCore.App.runtimeconfig.json'
from clr_loader import get_coreclr
from pythonnet import set_runtime
rt = get_coreclr(runtimeConfigPath)
set_runtime(rt)
import clr
currentFolder = os.getcwd()
dllFolder = currentFolder + r'/myCustom'
sys.path.append(dllFolder)
clr.AddReference("Someones.Platform.Custom.Client")
from System.Net import ServicePointManager, SecurityProtocolType
from System import Uri, AppDomain, ResolveEventHandler
from System.Reflection import AssemblyName, Assembly
from Someones.Platform.Custom.Client import (
CustomClientBuilder ...
) # <-- raises ModuleNotFound here
- If there was a crash, please include the traceback here.
Traceback (most recent call last):
File "demo.py", line 26, in <module>
from Someones.Platform.Custom.Client import (
ModuleNotFoundError: No module named 'Someones'
I understand that without the DLL you cannot reproduce this issue. I am not able to provide the DLL as it is proprietary, and further, I am not the author or maintainer. I am able to investigate further, and can build the DLL from source, so what would be helpful to me is some kind of guidance on how to proceed with debugging. I am an experienced python developer, but not deeply versed in .NET/C#.
the guidance for using Fuslogvw.exe is not exactly helpful since I don’t have any windows machine on which to run an exe.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (6 by maintainers)
Top GitHub Comments
@filmor I am facing similar issue. Could you please help in fixing this? I am using .Net Core 5.0 python 3.8
@filmor