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

[BUG] No module named 'typing_extensions' #3511

Closed
2 tasks done
vytdv opened this issue Oct 1, 2024 · 6 comments · Fixed by #3513
Closed
2 tasks done

[BUG] No module named 'typing_extensions' #3511

vytdv opened this issue Oct 1, 2024 · 6 comments · Fixed by #3513

Comments

@vytdv
Copy link

vytdv commented Oct 1, 2024

Describe the bug

Since rich 13.9.0 has been released, when I try to upload a package with twine, I'm getting the following error:

python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/site-packages/twine/__main__.py", line 54, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/twine/__main__.py", line 33, in main
    error = cli.dispatch(sys.argv[1:])
  File "/usr/local/lib/python3.9/site-packages/twine/cli.py", line 121, in dispatch
    main = registered_commands[args.command].load()
  File "/usr/local/lib/python3.9/site-packages/importlib_metadata/__init__.py", line 189, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line [228](https://gitlab.com), in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/twine/commands/upload.py", line 28, in <module>
    from twine import settings
  File "/usr/local/lib/python3.9/site-packages/twine/settings.py", line 23, in <module>
    from twine import repository
  File "/usr/local/lib/python3.9/site-packages/twine/repository.py", line 19, in <module>
    import rich.progress
  File "/usr/local/lib/python3.9/site-packages/rich/progress.py", line 45, in <module>
    from typing_extensions import Self  # pragma: no cover
ModuleNotFoundError: No module named 'typing_extensions'

When I manually install typing_extensions or when I fix rich version to 13.8.1 the problem doesn't appear.

It's pretty similar to #2979.

Copy link

github-actions bot commented Oct 1, 2024

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@cpnielsen
Copy link

This specifically comes from this commit/change: 67e68f3#diff-77d13adf0fa7cbb6c2fa6adba6462b8d37e1797ab2f23229c8b6d84d7ba0fb6dR42

The project requires typing-extensions only if python < 3.9, but this change makes it a requirement for python < 3.11.

@danielrbradley
Copy link

cc: @willmcgugan for visibility

kajinamit added a commit to kajinamit/rich that referenced this issue Oct 1, 2024
Since 67e68f3 was merged, the rich.progress module requires
the external typing_extensions library in Python 3.9 and 3.10. Bump
the upper version to meet that requirement.

Fixes: Textualize#3511
kajinamit added a commit to kajinamit/rich that referenced this issue Oct 1, 2024
Since 67e68f3 was merged, the rich.progress module requires
the external typing_extensions library in Python 3.9 and 3.10. Bump
the upper version to meet that requirement.

Fixes Textualize#3511
kajinamit added a commit to kajinamit/rich that referenced this issue Oct 1, 2024
Since 67e68f3 was merged, the rich.progress module requires
the external typing_extensions library in Python 3.9 and 3.10. Bump
the upper version to meet that requirement.

Fixes Textualize#3511
@kajinamit
Copy link

I hit the same problem via the bandit tool (the tool depends on rich). I've submitted the PR which hopefully fixes the issue and appreciate any feedback.

Copy link

github-actions bot commented Oct 1, 2024

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

@danielrbradley
Copy link

Thank you @willmcgugan for the speedy hot fix ❤️

I can confirm this has resolved our issue (using via twine).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants