-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Colors do not work if tqdm imported. #678
Comments
just to confirm, if you |
We ran into this issue as well because |
Found the issue - for now, please use: import tqdm # or whatever tqdm imports you use
import colorama
colorama.deinit()
colorama.init(strip=False) Will patch soon... |
I've been experiencing this issue for a long time. I just happened across this page, but the proposed temporary fix is not working for me. Has anything changed since then? I'm on Python 3.8, I just updated Actually, using this on it's own disables my colors entirely.
EDIT: I don't know how relevant this is, but I thought I'd mention that I have EDIT 2: Sorry for the multiple edits. I'm not familiar with how exactly |
It has everything it needs, no worries. to be clear, are you saying:
|
All of the above. If I do a simple
I get a green "Hello". Once I import If I do
I get green text again. But I lose it again with the following.
Sorry if that seemed condescending. I just wanted to be explicit. If this is all normal, then I apologize for commenting on this issue. I can work with this now that I know how to get around the issue, but I suppose you can never have too much data on possible issues. EDIT: I just thought it was odd that the suggested temporary fix (below) didn't have the expected effect. Unless I misread
EDIT 2 (lol): Sorry, I'm not complaining, just inquiring. |
hmm this is odd. Looks related to tartley/colorama#79 importing
print("\x1b[38;2;0;255;0mCorrectly green\x1b[0m")
import colorama
print("\x1b[38;2;0;255;0mCorrectly green\x1b[0m")
colorama.init(strip=False)
print("\x1b[38;2;0;255;0mShould be green but isn't\x1b[0m")
colorama.deinit()
print("\x1b[38;2;0;255;0mCorrectly green\x1b[0m")
colorama.init()
print("\x1b[38;2;0;255;0mShould be green but isn't\x1b[0m") I get this on linux (everything correctly green in terminal as well as notebook): Based on your report I'd take a wild guess that you're using windows and a terminal which can understand ANSI codes but can't understand the windows API calls that |
I don't know if this is relevant, but it all works correctly if I use cmd to ssh into my Raspberry Pi, and do all the same things from there. I don't know if this is relevent either, but both this laptop and my previous PC, by default, would just print the actual If there's anything else I can do or provide that would be helpful, don't hesitate to ask. I don't mind. |
It seems to only be eating the "True Color" sequences (forgive me if that's not the correct term) aka But surprisingly, I can use 3/4 bit sequences (again, forgive me if not the correct term) just fine aka I'm not sure what this means, if anything, but I thought you should know. EDIT: I just realized, I should probably take this on over to the Final edit: tartley/colorama#217 My legwork was for naught. Sorry for bothering you about this. Although, I did finally find something concrete on why this happens. |
correctly diagnosing and liking an appropriate issue is not for naught! Thanks; closing for now as it seems to be an issue with an upstream library. For now, this may be required on some systems:
|
This code works...
but after importing the same code does not work.
Python:
(base) C:\Users\212574384>python --version
Python 3.7.0
OS: win 10
The text was updated successfully, but these errors were encountered: