Error:
\nTraceback (most recent call last):\n File \"c:\\Code\\SampleLib\\Test.py\", line 18, in <module>\n from Neighborly import *\nModuleNotFoundError: No module named 'Neighborly'\nLooking at the IL metadata, I can confirm that Neighborly is the assembly name and also the namespace.
\n
I created a sample class with an Add function that compiled and was successfully imported into Python.
\nI also added all of the same Nuget dependencies and recompiled them. It continues to call the Add function.
\nThis rules out a dependency load failure.
I'm running on Windows 11 with Python 3.10.11.
\nAny ideas? 🙏
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"As documented, by default we load a .NET Framework runtime at startup. The simplest option is to run import pythonnet; pythonnet.load(\"coreclr\") before importing clr.
-
|
I'm trying to pull my .NET library into Python and getting a failure on the from/import statement. Repro Steps:
Error: Looking at the IL metadata, I can confirm that Neighborly is the assembly name and also the namespace. I created a sample class with an Add function that compiled and was successfully imported into Python. I'm running on Windows 11 with Python 3.10.11. Any ideas? 🙏 |
Beta Was this translation helpful? Give feedback.
-
|
As documented, by default we load a .NET Framework runtime at startup. The simplest option is to run |
Beta Was this translation helpful? Give feedback.
-
|
I am also facing same error- ModuleNotFoundError: No module named- No change in the error |
Beta Was this translation helpful? Give feedback.
As documented, by default we load a .NET Framework runtime at startup. The simplest option is to run
import pythonnet; pythonnet.load("coreclr")before importingclr.