SystemError: initialization of QtCore failed without raising an exception
Asked Answered
L

2

6

I am trying to plot something with matplotlib but when I import it like this:

import matplotlib.pyplot as plt

in Pycharm Community 2016.1.4 using Anaconda version 3.5.1, I get this error:

from PyQt4 import QtCore
SystemError: initialization of QtCore failed without raising an exception

What is wrong here? I havent found anything via google or here on SO that is the same as my problem.

Lamontlamontagne answered 10/11, 2016 at 16:43 Comment(5)
What is the full error you get, including traceback? Can you try from PyQt4 import QtCore without importing matplotlib and will it give the same error?Joo
I am having the same issue @Lamontlamontagne Ever figure out a fix? When i try from PyQt5 import QtCore in PyCharm, I receive the following error: /usr/local/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /Users/me/pyfo/project/testing.py Traceback (most recent call last): File "/Users/me/pyfo/project/testing.py", line 1, in <module> from PyQt5 import QtCore SystemError: initialization of QtCore failed without raising an exception Process finished with exit code 1 Jacinthe
@Jacinthe Not really, I ended up re-installing Python and PyQt - and lo and behold, it worked. Not very satisfactory, but thats how I solved it.Lamontlamontagne
interesting, I did the same thing. How did you install? Homebrew or download from site? I hear some of these issues will be fixed in May with the new release of PyQt5 5.9 Try running this script if you have PyQt5.8: pythonspot.com/en/pyqt5-menu Here is my error: pastebin.com/RJ3gnrAT Does it work for you @Lamontlamontagne ?Jacinthe
For those coming here because they get the SystemError: initialization of QtCore failed without raising an exception error despite that pyqt is installed. Check your version. I had version 5.9.2. Upgrading to 5.15 fixed the problem for me.Arris
A
5

I would Suggest you do these things it will definitely work as it worked for me.

python -m pip install PyQt5

This will completely resolve this issue by re-installing it with all dependencies required.

Thanks.

Autoionization answered 1/5, 2020 at 4:17 Comment(0)
E
-1

Solved this issue with :

conda install -c conda-forge pyqt
Exobiology answered 29/7, 2021 at 23:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.