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

'Colorama' has no attribute 'init' and has no attribute 'just_fix_windows_console' #385

Closed
RParkerE opened this issue Mar 11, 2024 · 1 comment

Comments

@RParkerE
Copy link

I am on Windows Version 10.0.19045.4046 using Python 3.7.16 with Colorama 0.4.6 installed in my anaconda environment with python 3.7. When trying to import an external library that uses colorama I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\pypose\__init__.py", line 3, in <module>
    from .lietensor import LieTensor, Parameter, SO3, so3, SE3, se3, Sim3, sim3, RxSO3, rxso3
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\pypose\lietensor\__init__.py", line 2, in <module>
    from .lietensor import LieTensor, Parameter
  File "C:\Users\user\anaconda3\envs\CARLA\lib\site-packages\pypose\lietensor\lietensor.py", line 3, in <module>
    import torch, warnings
  File "C:\Users\user\anaconda3\envs\CARLA\lib\site-packages\torch\__init__.py", line 884, in <module>
    from torch import hub as hub
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\torch\hub.py", line 20, in <module>
    from tqdm.auto import tqdm  # automatically select proper tqdm submodule if available
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\__init__.py", line 3, in <module>
    from .cli import main  # TODO: remove in v5.0.0
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\cli.py", line 9, in <module>
    from .std import TqdmKeyError, TqdmTypeError, tqdm
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\std.py", line 20, in <module>
    from .utils import (
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\utils.py", line 28, in <module>
    colorama.init(strip=False)
AttributeError: module 'colorama' has no attribute 'init'

I tried to edit the tqdm/utils.py file to use just_fix_windows_console() instead and get a similar issue:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\pypose\__init__.py", line 3, in <module>
    from .lietensor import LieTensor, Parameter, SO3, so3, SE3, se3, Sim3, sim3, RxSO3, rxso3
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\pypose\lietensor\__init__.py", line 2, in <module>
    from .lietensor import LieTensor, Parameter
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\pypose\lietensor\lietensor.py", line 3, in <module>
    import torch, warnings
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\torch\__init__.py", line 884, in <module>
    from torch import hub as hub
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\torch\hub.py", line 20, in <module>
    from tqdm.auto import tqdm  # automatically select proper tqdm submodule if available
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\__init__.py", line 3, in <module>
    from .cli import main  # TODO: remove in v5.0.0
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\cli.py", line 9, in <module>
    from .std import TqdmKeyError, TqdmTypeError, tqdm
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\std.py", line 20, in <module>
    from .utils import (
  File "C:\Users\usr\anaconda3\envs\CARLA\lib\site-packages\tqdm\utils.py", line 28, in <module>
    colorama.just_fix_windows_console(strip=False)
AttributeError: module 'colorama' has no attribute 'just_fix_windows_console'
@RParkerE
Copy link
Author

Found a solution in another issue.

You have to import colorama using from colorama import initialise

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

No branches or pull requests

1 participant