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

AttributeError: module 'importlib' has no attribute 'util' #945

Closed
wants to merge 1 commit into from

Conversation

nrrpinto
Copy link

@nrrpinto nrrpinto commented Aug 3, 2021

I was getting this error in line 444 without the "import importlib.util"

After reading the documentation, this solved the issue.

https://docs.python.org/3/library/importlib.html

I was getting this error in line 444 without the "import importlib.util"

After reading the documentation, this solved the issue.

https://docs.python.org/3/library/importlib.html
@slovdahl
Copy link

slovdahl commented Feb 14, 2022

This PR and #930 try to solve the same problem.

@yozik04
Copy link

yozik04 commented Feb 21, 2022

Can we get this merged please.

For python 3.9. We need to specifically import importlib.util in core.py.

Construct uses importlib.util here

module = importlib.util.module_from_spec(module_spec)

Easy to test.

  1. Install python 3.9.
  2. Create venv
  3. venv/bin/pip construct
  4. Create simple script that parses something.
  5. IMPORTANT. Run script from console! (Most IDEs and testing frameworks do additional imports so the bug becomes hidden)

@arekbulski
Copy link
Member

Okie dokie. I added 2 imports and pushed it to pypi. Please upgrade your installs and confirm the bug has gone away. The CI reports all is well, but it said so even before so...

@yozik04
Copy link

yozik04 commented Feb 26, 2022

I can confirm that latest fix has solved the issue. Thank you for cooperation!

@arekbulski arekbulski closed this May 17, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants