Corrupted visual from python chromeos linux - python-3.x

I am using a chromebook with linux beta turned on to use a terminal to run python3 scripts. they worked fine until recently when any pop out window (pygame, pyplot) look corrupted. the windows have black bars covering them for pyplot or are completely covered in black for pygame. the code in the python scripts are unchanged and worked just fine a couple of weeks ago.
I have already turned off linux beta, then returned it back on, reinstalling packages which didn't alleviate the issue. Any help is IMMENSELY appreciated!!

I installed Qt5 bindings via pip install PyQt5 and changed the backend to Qt5Agg per How to change backends in matplotlib / Python and that fixed the black bars for me.

Related

Incorrect rendering in Anaconda + Spyder (wrong colours in text)

When opening Anaconda (and starting Spyder from it) today, I experienced some (to me) unexplainable, rendering problems (I'm not sure whether this is the correct term). The text is not displayed as it normally is, see example pictures below:
This is an example for how it looks like in the Anaconda Navigator (GUI)
This is how the Spyder editor looks like in light mode -> green dots inside the black text
This is how the Spyder editor looks like in dark mode-> pink dots inside the black text
The icons in Spyder and the text inside the documentation window are not touched by this.
The warning that I get in the shell is: libpng warning: bKGD: invalid, but I did not find any helpful resources on it.
`
I do not have these problems in any other program, everything looks normal.
I uninstalled and reinstalled anaoconda completely using this approach (link to guide), which is basically what the Anaconda Docs are recommending, but the same thing occurs in the fresh install as well.
I'm using Ubuntu 20.04.1 LTS with KDE, Anaconda Navigator 1.9.12 and Spyder 4.1.4.
Can you point me in a direction of how to resolve this? Thanks a lot!
Let me know if any useful information is missing!
I fixed it by first install ImageMagick
sudo apt install imagemagick-6.q16
and then running
cd <anaconda location>
mogrify $(find . -name '*.png')
This fixed the problem for me.

Tkinter crashes computer after MacOS 10.14.6 update

After updating my 2019 Macbook Pro yesterday to MacOS Mojave 10.14.6, a tkinter application that I have packaged with pyinstaller now crashes my computer. The screen turns black for a second, and then restarts to the login screen. When I run the program through the command line (unpackaged), it runs just fine.
The error code that appears several times in terminal is: CGSTrackingRegionSetIsEnabled returned CG error 268435459.
The research I've done has led me to these links:
This unanswered StackOverflow question
This semi-related SuperUser question
This question on the Japanese Q&A site teratail
The unanswered StackOverflow question is slightly different than my own problem, as it seems that that user cannot create a Tk() window at all, whereas I can create a Tk() window (including the Python IDLE), but it breaks when I package it with pyinstaller.
The SuperUser question is unanswered, but as one of the answers suggest I have uninstalled and reinstalled pyinstaller to no avail.
The question on teratail was answered, and says that the problem was fixed by uninstalling "Anaconda", but I don't know what Anaconda is or how to uninstall it.
I suspect that this is a problem with the MacOS update, and that there is nothing I can do to fix it and I'll have to wait for a patch.
Why is this happening? How can I fix it?
This problem has troubled me for a long time. My macOS version is 10.14.6 (Mojave). Running tkinter will crash the system, but I don’t want to update macOS version to 10.15 (Catalina) for this problem.
I got a solution by updating the python version.
My own test results, python versions 3.8.2 and 3.8.3 can fix the problem, but python versions 3.8.1, 3.7.x, 3.6.x will cause the crash.
I can confirm that this happens with Python 3.7.x. Moving to 3.8.3 fixes the problem.
Workaround: boot in Safe Mode..
(Other apps are experiencing this.)
The macOS Window Server is crashing..
The Console.app contains the crash report in the "System Reports" node.
Process: WindowServer
Thread 0 (main thread) crashes in CGXBeginSurfaceLayerUpdate
I had the same problem with Mac OSX 10.14.6 completely crashing with no error messages and logging me out or rebooting. It was fixed by removing Anaconda and using the python.org ver 3.7.4. A good link for removing Anaconda is here. How to uninstall Anaconda completely from macOS
The new MacOS Catalina (Version 10.15) update seems to fix the problem for me. By specifying the tcl version and making sure the right tcl is used, I was able to successfully bundle and run my python script with tkinter. Yay!

Mac OS (Mojave) - Pycharm backend : TkAgg not working, graphs are blank

I am fairly new to python (and Stackflow) so apologies if this is a repost. I am currently run Pycharm on my iMac (with Mac OS Mojave), python install from Anaconda.
I am having some issues with Matplotlib as everytime I plot a graph I don't see anything. The backend currently uses TkAgg. I googled the issue and came across many links and tried to change the backend in matplotlibrc, but that just gave me errors.
It is Mojave specific problem? I have another Mac with High Sierra (which uses MacOSX in the backend) and Matplotlib runs fine on it. I tried changing the backend on my iMac to MacOSX but that doesn't work. Any help will be really appreciated as I have already spend more than 3-4 hours (in vain!) to fix the problem
If I need to change the backend in matplotlibrc, could you advise what should I be using?
thanks,
PK
if you use virtualenv in Mojave, you have to install matplotliv (v1.3.1) at virtualenv. ** NOT VERSION 2.2.3 **. so, try the below command (btw, in your code, 'TkAgg' is needless):
$pip install --no-cache-dir matplotlib==1.3.1
everything will be fine.

Spyder not launching in python 3.7

Several days ago, Spyder stopped running. I tried almost everything on forums. I desinstalled it and downloaded last version of anaconda package, but to no avail.
This is what the anaconda prompt shows me
As I said, I tried uploading qt, PySide, and even tried to locate .spyder2 to erase it as is said in Anaconda webpage.
I really don't know what else to try
EDIT: Don't know if you need versions of anything, because as I said, it is the standard last version package available in Anaconda.
EDIT2: I'm using Windows 10

gnuplot cursor not moving on OSX 10.9?

I have recently installed OSX 10.9, with the latest version of XQuartz and gnuplot 4.6.4
When I move the cursor across the gnuplot window the coordinates shown in the bottom left corner do not update. I am testing this using plot sin(x). The desired functionality I am describing is seen here.
I believe that this was working under OSX 10.7, so I am not sure what is the problem.
Installing gnuplot through macports instead of building from the official sourceforge download site solved the issue.
I also installed the wxt terminal while I was at it since it offers some improved features, but x11 works fine too. (Thanks #Christoph for bringing me to learn about wxt).
Instructions:
Install macports
Open the terminal and enter port variants gnuplot followed by sudo port install gnuplot +wxwidgets
(Note: the installation may take a while, but is all automated)

Resources