Click here to Skip to main content
15,888,221 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Paths:
echo $PATH: /usr/local/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/me/.rvm/bin

PYTHON PATH: /usr/local/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/usr/local/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/usr/local/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/usr/local/lib/python3.6/site-packages


I run the following program (Python 3.6) listed here: http://zetcode.com/gui/pyqt5/firstprograms/

Python
import sys
from PyQt5.QtWidgets import QApplication, QWidget`


if __name__ == '__main__':

    app = QApplication(sys.argv)

    w = QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Simple')
    w.show()

    sys.exit(app.exec_())


and continue to receive errors. I moved a few folders around after some other errors but things should be working now. I receive the following error:

from PyQt5.QtWidgets import QApplication, QWidget
SystemError: initialization of QtWidgets failed without raising an exception


What I have tried:

I installed QT but also installed PyQt5 and Sip Via Homebrew and Pip. Updated to the most recent versions of both, ran the -qmake and make install commands- took about 30 min. Typed this in the terminal (Mac):

python3 configure.py --qmake=/usr/local/Cellar/qt5/5.8.0_1/bin/qmake --sip=/usr/local/Cellar/sip/4.19.1/


Then make then make install.
No errors.

from PyQt5 import Qtcore Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name 'Qtcore' >>>


from PyQt5.QtWidgets import QApplication, QWidget Traceback (most recent call last): File "<stdin>", line 1, in <module> SystemError: initialization of QtWidgets failed without raising an exception


no errors when I
Python
import PyQt5



SUMMARY OF WHEN RAN IN TERMINAL:

Python
Python 3.6.0 (default, Mar  4 2017, 12:32:34) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtCore, QtGui, QtWidgets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: initialization of QtCore failed without raising an exception
>>> from PyQt5 import QtWidgets
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: initialization of QtWidgets failed without raising an exception
>>> from PyQt5 import QtGui
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: initialization of QtGui failed without raising an exception
>>> import PyQt5
>>> 
>>>


I would really appreciate any help. Thank you.
Posted
Updated 20-Mar-17 21:05pm
v3

1 solution

CLOSED:
Reinstalled everything.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900