Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ssalmans428 opened this issue Apr 1, 2024 · 5 comments

Comments

@ssalmans428
Copy link

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

@slozier
Copy link
Contributor

slozier commented Apr 1, 2024

Why are there { and } in your libs path?

@ssalmans428
Copy link
Author

Why are there { and } in your libs path?

Hi
I modified the syntax now also the error is coming related to Module _sre. I have not used this one in my Script. From where this is popping up?

Can you provide me the correct way to map the libs?

image

@slozier
Copy link
Contributor

slozier commented Apr 1, 2024

_sre is a built-in module and not part of the lib. It sounds like IronPython.Modules.dll is not getting copied to your output folder (same issue as #1778).

@ssalmans428
Copy link
Author

_sre is a built-in module and not part of the lib. It sounds like IronPython.Modules.dll is not getting copied to your output folder (same issue as #1778).

Hi,
I manually place the dll's in output folder but now i am getting the error related to Import requests.
1.Requests module is not available in ironpython?
2.I can see request.py is available under urllib folder are these same?
3.Any workaround for requests module in ip?

image
image

@slozier
Copy link
Contributor

slozier commented Apr 4, 2024

The requests module is not part of the standard library. You'll have to find a compatible version (e.g. 2.21.0) and make it (and its dependencies) available in your search paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants