Pint Quantity Console Outputs Stuck in Latex Mode

34 Views Asked by At

I have been using pint for a little while now. At some point I did something to get fancy outputs in my console, I think from a LaTex printer or something similar. Now I cannot figure out how to revert to more normal "pretty printing" behavior. The outputs look good, but they cannot be copy/pasted like text. I can get sympy outputs to behave similarly by running a sympy init_printing() which I believe grabs a LaTex printer if one is available. When I turn this off, all of the console outputs revert to normal behavior but pint quantities are still output as a mystery object. I can force the desired behavior by printing a formated string like f"{quantity:~P}" to output a pretty (unicode?) string that is copy/paste friendly.

Screenshot included to illustrate. Any hints at how to control this behavior would be amazing!

I'm using spyder 5.3.3, python 3.9, pint 0.2

Example Output

I have tried...

Running a sympy session with use_latex = False, no change,

Starting a session with no other packages imported.

Resetting spyder to factory settings.

None of these have made any changes. It feels like something obvious but I'm just not seeing it.

-TIA

0

There are 0 best solutions below