No module named 'importlib_metadata' with python3.8
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Linux
- Poetry version: `1.0.0b2
- Link of a Gist with the contents of your pyproject.toml file: https://github.com/sobolevn/flake8-positional-only/blob/5672a153ba6e0ca89e7396fd18669c8697709cca/pyproject.toml
Issue
When I run poetry run
with python3.8
I get this error:
0.25s$ poetry run flake8 .
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.8.0/bin/poetry", line 5, in <module>
from poetry.console import main
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/console/__init__.py", line 1, in <module>
from .application import Application
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/console/application.py", line 7, in <module>
from .commands import AboutCommand
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/console/commands/__init__.py", line 4, in <module>
from .check import CheckCommand
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/console/commands/check.py", line 1, in <module>
from poetry.factory import Factory
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/factory.py", line 15, in <module>
from .json import validate_object
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/poetry/json/__init__.py", line 4, in <module>
import jsonschema
File "/home/travis/virtualenv/python3.8.0/lib/python3.8/site-packages/jsonschema/__init__.py", line 31, in <module>
import importlib_metadata
ModuleNotFoundError: No module named 'importlib_metadata'
Link to the CI: https://travis-ci.org/sobolevn/flake8-positional-only/jobs/600167655#L368
I have tried to:
- Run
poetry
with-vvv
- no change in the result - Install
importlib_metadata
manually inside thevenv
and the root system - Install
poetry
viapip
and viacurl
(curl
has different issue, see #1377)
No luck.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:14
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[Fixed] ModuleNotFoundError: No module named 'importlib ...
How to Fix “ModuleNotFoundError: No module named 'importlib-metadata'” in PyCharm · Open File > Settings > Project from the PyCharm menu. · Select...
Read more >No module named 'importlib.metadata' - python - Stack Overflow
Try installing this lib manually, using : pip install importlib-metadata. or. pip3 install importlib-metadata.
Read more >Using importlib.metadata — Python 3.11.1 documentation
importlib_metadata is a library that provides access to the metadata of an installed Distribution Package, such as its entry points or its top-level...
Read more >importlib-metadata - PyPI
This package supplies third-party access to the functionality of importlib. metadata including improvements added to subsequent Python versions.
Read more >ModuleNotFoundError: No module named 'importlib-metadata'
After the installation of importlib-metadata python library, ModuleNotFoundError: No module named 'importlib-metadata' error will be solved.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is probably caused by a typo in this line: https://github.com/sdispater/poetry/blob/481d81d/pyproject.toml#L58
It should be
< 3.8
, not<= 3.8
.Also experimenting this issue on Python 3.8.0 / TravisCI: https://travis-ci.com/florimondmanca/ddtrace-asgi/jobs/252426060
I managed to fix the issue by installing using the latest Poetry version via
get-poetry.py
:Successful build here: https://travis-ci.com/florimondmanca/ddtrace-asgi/jobs/252427083
Not sure what the origin of the issue is, nor why it is only affecting 3.8 — perhaps a clash between
importlib_metadata
/importlib.metadata
/ Poetry’s own vendorized dependencies?