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

Error showing no module named imp #1592

Closed
kaustubhnair02 opened this issue Nov 7, 2024 · 4 comments
Closed

Error showing no module named imp #1592

kaustubhnair02 opened this issue Nov 7, 2024 · 4 comments
Assignees

Comments

@kaustubhnair02
Copy link

While trying to run this code on jupyter notebook an error occurred in the line:from lit_nlp import notebook . It further showed that:
File ~/Desktop/LIT_test/venv/lib/python3.12/site-packages/ml_collections/config_flags/config_flags.py:19
16 """Configuration commmand line parser."""
18 import errno
---> 19 import imp
20 import os
21 import re

ModuleNotFoundError: No module named 'imp'.
What might be the issue because it is running fine with google colab but having issue with jupyter notebook.
Screenshot 2024-11-06 at 10 09 32 PM

@bdu91
Copy link
Collaborator

bdu91 commented Nov 8, 2024

It seems a problem with python 3.12, can you try 3.11 and see if it works?

@RyanMullins
Copy link
Member

Yes, imp was removed in Py3.12 and the ml-collections package knew about and fixed it on GitHub back in Jun 2024, but they haven't published an update on PyPI since Jan 2022.

Short term, you can get around this by reinstalling ml-collecitons from source with pip:

pip install -U https://github.com/google/ml_collections.git@2699256

Longer term we need ml-collections to publish an update on PyPI. Luckily, ml-collections is also a Google-owned project, so I can reach out to the maintainers internally and hopefully get this sorted quickly.

@RyanMullins RyanMullins self-assigned this Nov 8, 2024
@RyanMullins
Copy link
Member

FYI: I've filed an internal bug to update ml-collections on PyPI. I will update and close this issue once the pakcage has been updated.

@RyanMullins
Copy link
Member

The ml-collections team has published v1.0.

https://pypi.org/project/ml-collections/

I'm not aware of any other transient deps on imp, so I'm going to close this issue, but please re-open it if you run into any others.

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

3 participants