IronLanguages / IronLanguages/ironpython3

IronPython.Runtime.Exceptions.ImportException: 'No module named 'xml.etree.ElementTree''

Open
#1,787 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2.8k
Forks
316
Avg merge
1d 9h
Merged PRs (30d)
1

Description

Hi,

I am trying to run python script from C# (.net Framework 4.7 Class Library Project) . I am using Visual studio 2022.
I have added IronPython 3.4.1 as reference to my project, IronPython.StdLib 3.4.1 also added.

When there are no import statements inside the script it is running fine, when there is an import statement in my script file its throwing an "No Module Found error" even though the module is found under the lib folder.

This error is not specific to a module its giving me error for all the basic modules like Math module also.

I added the Searchpaths as well mapping to the lib folder, but still getting the error. Can you tell me what needs to be changed here?

Capture6
Capture5
Capture4

Let me know if you require more details......

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the import failure in the .NET Framework 4.7 class library with IronPython 3.4.1, using the script imports and SearchPaths mapped to the lib folder. Inspect how the embedding setup locates IronPython.StdLib for xml.etree.ElementTree and math. Done means standard-library imports work from the hosted script.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, python
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.