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

Python solver: ModuleNotFoundError: No module named 'java.lang' (or 'java.io') #1251

Open
ge0ffrey opened this issue Dec 4, 2024 · 2 comments
Labels
bug Something isn't working process/needs triage Requires initial assessment of validity, priority etc. python Is related to Python code.

Comments

@ge0ffrey
Copy link
Contributor

ge0ffrey commented Dec 4, 2024

If the python solver is executed from a working directory that contains a directory called java (or maybe javax too), we get this error message:

ModuleNotFoundError: No module named 'java.lang'

Give a nice error message.

(this is an issue for the backlog)

@ge0ffrey ge0ffrey added bug Something isn't working process/needs triage Requires initial assessment of validity, priority etc. labels Dec 4, 2024
@triceo triceo added the python Is related to Python code. label Dec 4, 2024
@Christopher-Chianelli
Copy link
Contributor

Welcome to the world of Python packaging, where what you see is the expected behaviour of Python.
In particular, by having a directory with a given name in your working directory, Python will automatically consider it a namespace package (and it will take precedence over import hooks).

See https://peps.python.org/pep-0420/#specification for details.

@Christopher-Chianelli
Copy link
Contributor

(Something similar will happen if you used the name timefold for your directory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working process/needs triage Requires initial assessment of validity, priority etc. python Is related to Python code.
Projects
None yet
Development

No branches or pull requests

3 participants