ModuleNotFoundError: No module named 'tomllib'

See original GitHub issue

Describe the bug When I run tests in Travis CI against Python3.11-dev I get the following error:

$ coverage run --branch pedantic/tests/tests_main.py

Traceback (most recent call last):

  File "/home/travis/virtualenv/python3.11-dev/bin/coverage", line 5, in <module>

    from coverage.cmdline import main

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/travis/virtualenv/python3.11-dev/lib/python3.11/site-packages/coverage/__init__.py", line 15, in <module>

    from coverage.control import Coverage, process_startup

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/travis/virtualenv/python3.11-dev/lib/python3.11/site-packages/coverage/control.py", line 20, in <module>

    from coverage.collector import Collector, CTracer

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/travis/virtualenv/python3.11-dev/lib/python3.11/site-packages/coverage/collector.py", line 10, in <module>

    from coverage.config import CoverageConfig

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/travis/virtualenv/python3.11-dev/lib/python3.11/site-packages/coverage/config.py", line 16, in <module>

    from coverage.tomlconfig import TomlConfigParser, TomlDecodeError

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/home/travis/virtualenv/python3.11-dev/lib/python3.11/site-packages/coverage/tomlconfig.py", line 16, in <module>

    import tomllib      # pylint: disable=import-error

    ^^^^^^^^^^^^^^

ModuleNotFoundError: No module named 'tomllib'

To Reproduce How can we reproduce the problem? Please be specific. Don’t link to a failing CI job. Answer the questions below:

  1. What version of Python are you using? Python 3.11.0a3+
  2. What version of coverage.py shows the problem? 6.4
  3. What code shows the problem? Does not matter.
  4. What commands did you run? coverage run --branch pedantic/tests/tests_main.py

Expected behavior Run tests with coverage.

Additional context Nothing.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
hugovkcommented, Jun 6, 2022

And Travis CI have now updated 3.11-dev and it now points to:

3.11.0b3+ (heads/3.11:fae93ab, Jun  3 2022, 16:03:01) [GCC 9.3.0]

🎉

https://travis-ci.community/t/update-python-3-11-dev/13039/2?u=hugovk

3reactions
nedbatcommented, Jun 2, 2022

This is now released as part of coverage 6.4.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python 3.11 ModuleNotFoundError: No module named 'tomllib'
Describe the bug In Python 3.11 it is raising exception with ModuleNotFoundError. To Reproduce Install Python 3.11 $ black .
Read more >
ModuleNotFoundError: No module named 'toml-python'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'toml-python' How to remove the Module.
Read more >
numpy - Unable to install python package "toml" - Stack Overflow
Apparently the problem was that I have python 2 and 3, I was installing toml in 3. Running: sudo -H pip2 install toml....
Read more >
[Fixed] ModuleNotFoundError: No module named 'toml' - Finxter
Quick Fix: Python raises the ImportError: No module named 'toml' when it cannot find the library toml . The most frequent source of...
Read more >
Update Python `3.11-dev` - Travis CI Community
ModuleNotFoundError: No module named 'tomllib' · Issue #1390 · nedbat/coveragepy · GitHub · @Montana Please will you update 3.11-dev to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found