Click here to Skip to main content
13,558,007 members
Rate this:
 
Please Sign up or sign in to vote.
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/

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
import PyQt5



SUMMARY OF WHEN RAN IN TERMINAL:

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 20-Mar-17 13:03pm
Updated 20-Mar-17 21:05pm
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

CLOSED:
Reinstalled everything.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.180515.1 | Last Updated 21 Mar 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100