tartley / colorama

Simple cross-platform colored terminal text in Python
BSD 3-Clause "New" or "Revised" License
3.56k stars 253 forks source link

Error in atexit._run_exitfuncs: #332

Closed michaellongge163 closed 2 years ago

michaellongge163 commented 2 years ago

I install pytorch3D on window10+python3.8+cuda10.2+torch1.10 and get this error

...
...
Using d:\python38\lib\site-packages
Searching for pywin32==302
Best match: pywin32 302
Adding pywin32 302 to easy-install.pth file

Using d:\python38\lib\site-packages
Searching for colorama==0.4.4
Best match: colorama 0.4.4
Adding colorama 0.4.4 to easy-install.pth file

Using d:\python38\lib\site-packages
Finished processing dependencies for pytorch3d==0.6.1

zip_safe flag not set; analyzing archive contents...
pytorch3d.__pycache__._C.cpython-38: module references __file__
pytorch3d.datasets.r2n2.__pycache__.r2n2.cpython-38: module references __file__
pytorch3d.datasets.shapenet.__pycache__.shapenet_core.cpython-38: module references __file__
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "D:\Python38\lib\site-packages\colorama\ansitowin32.py", line 59, in closed
    return stream.closed
ValueError: underlying buffer has been detached

i dont know if pytorch3d problem or colorama problem, so i submit this issue if you fix this problem ,please tell me thanks

michaellongge163 commented 2 years ago

I found this problem solved by add environment variable on windows10 set PYTHONIOENCODING=utf-8:surrogateescape