I have installed PyQt using brew but when I am trying to import it, I just receive errors as follows:
>>> from PyQt4 import QtCore, QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
>>> from PyQt5 import QtCore, QtGui
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt5
Here's the command I used in terminal for installing PyQt in OSX:
brew install python qt pyqt pyside pyside-tools
Any idea what's gone wrong?
The most painless way to do python without messing around with modules is to install distributions. Two very good ones are Canopy Python and Anaconda. They have most, if not all, modules you are going to need for production. Pyqt and pyside are included in both of these distributions.
Related
I have installed sip-4.19.13 and PyQt5_gpl-5.11.3 (by specifiying ./configure.py --sip <path>) on a Raspberry PI 3 from sources (no packages found with apt or pip).
However, I can't manage to run qtdemo.py in the examples folder:
>>> from PyQt5 import QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: PyCapsule_GetPointer called with incorrect name
How can I fix it? I've googled it but not found any solutions...
I have the same problem with installed PyQt5_gpl-5.12,
from PyQt5.QtWebEngineWidgets import * ValueError: PyCapsule_GetPointer called with incorrect name,
then pip uninstall PyQt5 and pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyqt5==5.10.1
I am trying to get my old project clipmanager building and I am encountering the following error:
/home/user/.virtualenvs/clipmanager27/bin/python /home/user/development/clipmanager/clipmanager/app.py
Traceback (most recent call last):
File "/home/user/development/clipmanager/clipmanager/app.py", line 15, in <module>
from mainwindow import MainWindow
File "/home/user/development/clipmanager/clipmanager/mainwindow.py", line 12, in <module>
import dialogs
File "/home/user/development/clipmanager/clipmanager/dialogs.py", line 8, in <module>
from PySide import QtWebKit
ImportError: cannot import name QtWebKit
Process finished with exit code 1
I installed Pyside with pip install pyside. I do not even see QtWebKit.so in the site packages folder /home/user/.virtualenvs/clipmanager27/lib/python2.7/site-packages/PySide:
Did it get removed due to licensing?
For Arch Linux, install qt4 and also qtwebkit before installing PySide.
Here's what I'm getting when I try to run anki from the command line: `
Traceback (most recent call last):
File "/usr/bin/anki", line 5, in <module>
import aqt
File "/usr/share/anki/aqt/__init__.py", line 12, in <module>
from aqt.qt import *
File "/usr/share/anki/aqt/qt.py", line 22, in <module>
from PyQt4.QtWebKit import QWebPage, QWebView, QWebSettings
ImportError: No module named QtWebKit
“anki &” has ended`
Looking at my system I do notice I have a PyQt5.QtWebKit installed ( or something like that ) while here's asking for PyQt4. How do I reconcile ?
I finally managed to properly install PyQt4 based on these instructions : https://blog.qtibia.ro/2016/06/21/build-python-qt4-on-debian-testing/ And now I got anki running properly.
I also ran into this issue on Ubuntu MATE 17.04. The best solution I've found is to install the compiled version of Anki from their website -> https://apps.ankiweb.net/#linux since it bundles all the required libraries.
I am trying to import spynner into my python program (import spynner) ... when I run the script, I receive the following error message:
Traceback (most recent call last):
File "C:\Users\Michael\Desktop\webscraper.py", line 2, in <module>
import spynner
File "build\bdist.win32\egg\spynner\__init__.py", line 2, in <module>
File "build\bdist.win32\egg\spynner\browser.py", line 52, in <module>
ImportError: No module named PyQt4
I then tried to install this module called PyQt4 (pip install PyQt4), which resulted in the following error message:
Could not find any downloads that satisfy the requirement Pyqt4
How can this problem be solved?
PyQt is available for download from Riverbank.
You can get PyQt4 here: http://www.riverbankcomputing.com/software/pyqt/download
They have links to both the source (so you can build it yourself) or binary packages.
If you need the PyQt documentation for the various classes the framework provides, you get get that from here
I installed sip and PyQt but when i execute a python code like python tutorial.py , take this error. I installed pyqt with brew install and configure.py both.
Traceback (most recent call last):
File "untitled.py", line 4, in <module>
from PyQt4 import QtCore, QtGui
ImportError: dlopen(/Library/Python/2.7/site-packages/PyQt4/QtCore.so, 2): Symbol not found: __ZN10QArrayData11shared_nullE
Referenced from: /Library/Python/2.7/site-packages/PyQt4/QtCore.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/PyQt4/QtCore.so
I Solved this problem with delete Python and installing python and pyqt with macPorts.