-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Upgrading from 23.0.1 to 23.1 causes ModuleNotFoundError #11972
Comments
This is almost certainly due to how setuptools implements editable installs. In 23.1, we stopped invoking With that background, the problem you are seeing is that setuptools uses a different method for editable installs under PEP 660, which has different semantics. Specifically, it is a lot more precise over what is exposed to the import mechanism. Your project depends on the To get the old behaviour temporarily, you could get your users to install |
So an example short-term fix would be adding the
What would that longer-term fix look like -- is it possible to do with a |
Short-term, yes, I believe so. You should obviously check this. Long term, I don't know. This is effectively a setuptools change in behaviour, so you would be best explaining your use case to them and asking for advice. I don't know if they provide any advice or documentation on how to transition from "traditional" editable installs to PEP 660-based ones. I imagine they would say that you should either include the examples in your package, or provide the examples as a separate project that the users can install normally. Or maybe just don't use editable installs and manually modify But this isn't really a pip issue, so that's just my best guess. |
Just for reference, the change in behaviour was caused by this change (from the changelog):
|
Just to note that the same thing happened to us: 23.1 came out, and now none of our github actions work. Reverting to 23.0.1 works for now. |
Is there anything for pip to act on here? We are not going back to |
No. The OP has raised a setuptools issue for this, which is where any further discussion can happen. |
Description
Our GitHub Actions tests started failing two days ago when pip
23.1
was released, example test runs:Before 23.1, we were able to install our package locally using the following command:
python -m pip install -e '.[extra]'
We were previously able to run scripts that had import statements like the following:
Note that the
examples
module is a top-level folder in the GitHub repository. It is not under thesyne_tune
folder, since we don't want it to be included in the bundle that users typically pip install. If customers want to run our examples, we've been recommending that they check out the package locally and then run the examples.However, with
23.1
, now we get aModuleNotFound
:Is this behavior change intentional, perhaps from this removal from the changelog:
Expected behavior
Expected to be able to run the following script without having a ModuleNotFound error thrown on line 35: https://github.com/awslabs/syne-tune/blob/main/examples/launch_tensorboard_example.py#L35
pip version
23.1
Python version
3.8
OS
both Ubuntu & Mac
How to Reproduce
Check out https://github.com/awslabs/syne-tune, then run:
If I just do
pip install pip==23.0.1
, (the old version), I no longer see the errorOutput
Code of Conduct
The text was updated successfully, but these errors were encountered: