Textualize / rich

Rich is a Python library for rich text and beautiful formatting in the terminal.
https://rich.readthedocs.io/en/latest/
MIT License
49.04k stars 1.71k forks source link

[BUG] ModuleNotFoundError: No module named 'typing' #3334

Closed AlanMW closed 5 months ago

AlanMW commented 5 months ago

Describe the bug I am getting the following error when attempting to use rich: ModuleNotFoundError: No module named 'typing'

File "/home/user/Text_Gen/text-generation-webui-main/installer_files/env/lib/python3.11/site-packages/rich/__init__.py", line 4, in <module>
  from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union
ModuleNotFoundError: No module named 'typing'

Platform

Click to expand Linux, ssh from windows cmd prompt I may ask you to copy and paste the output of the following commands. It may save some time if you do it now. If you're using Rich in a terminal: ``` python -m rich.diagnose pip freeze | grep rich ``` ``` (/home/user/Text_Gen/text-generation-webui-main/installer_files/env) user@userserver:~$ python -m rich.diagnose Traceback (most recent call last): File "", line 189, in _run_module_as_main File "", line 112, in _get_module_details File "/home/user/Text_Gen/text-generation-webui-main/installer_files/env/lib/python3.11/site-packages/rich/__init__.py", line 4, in from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union ModuleNotFoundError: No module named 'typing' ``` ``` (/home/user/Text_Gen/text-generation-webui-main/installer_files/env) user@userserver:~$ pip freeze | grep rich Traceback (most recent call last): File "/home/user/Text_Gen/text-generation-webui-main/installer_files/env/bin/pip", line 7, in from pip._internal.cli.main import main File "/home/user/Text_Gen/text-generation-webui-main/installer_files/env/lib/python3.11/site-packages/pip/__init__.py", line 1, in from typing import List, Optional ModuleNotFoundError: No module named 'typing' ```
github-actions[bot] commented 5 months ago

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

TomJGooding commented 5 months ago

I'm afraid you have a problem with your Python environment, this isn't a Rich issue. Notice that trying to run just the pip freeze command gave you the same error.

willmcgugan commented 5 months ago

The typing module is in the standard library. If that doesn't exist then something is amis with your environment, as Tom pointed out. Try recreating your virtual environement?

github-actions[bot] commented 5 months ago

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual