Skip to content
\n

Error:

\n
Traceback (most recent call last):\n  File \"c:\\Code\\SampleLib\\Test.py\", line 18, in <module>\n    from Neighborly import *\nModuleNotFoundError: No module named 'Neighborly'\n
\n

Looking at the IL metadata, I can confirm that Neighborly is the assembly name and also the namespace.
\n\"image\"

\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.

\n

I'm running on Windows 11 with Python 3.10.11.

\n

Any 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.

","upvoteCount":2,"url":"https://github.com/pythonnet/pythonnet/discussions/2421#discussioncomment-10132002"}}}
Discussion options

You must be logged in to vote

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.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nickna
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants