I have a code that have QtWebEngineWidgets module from PyQt5. it works fine in raw form (.py) but throws the following .dll and openGL missing error when freeze through pyinstaller. PyQt5 and pyinstaller are both upto date.
Also, for your information, i am running this code on amazon c2 instance.
from the issue of Anaconda, the following command when run on the cmd, the error will be fix
set QT_OPENGL=desktop
solution in Anaconda Issues
Related
I'm developing a tool to be used in WinPE and have been facing an issue while using PySide2/PyQt5 in WinPE environment.
While importing QtGui, it says ImportError: DLL load failed while importing QtGui: The specified module could not be found.
But importing QtCore is successful.
If I use the same environment in another Windows machine it is successful.
I also developing a pyqt5 program run in winpe.
using pyinstaller convert it to exe and run successfully in a new win7 machchine.
when start at win10 pe the command line says below message.
The specified module could not be found.
I found one solution is using specific version of PyQT5 from below url
pip install PyQT5==5.9
https://stackoverflow.com/a/51821319/7324168
I have been building an application on Linux using python pygobject, and now I need to distribute it on Windows.
I first installed pygobject via msys2 (as per the official pygobject documentation)
Now, using msys2/mingw32, I can run my program typing
python3 main.py
But when I try to freeze it into a .exe with Pyinstaller, and try to run the produced .exe
If I Don't use --onefile, I get an import error on the _struct module (whereas "import _struct" works in python shell)
If I use --onefile, I get the Following error :
error:
lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.dll could not be extracted!
fopen: No such file or directory
I’m using the devel version of Pyinstaller. I know next to nothing on Windows OS… does anyone know how to fix that error ?
It sounds like you were on the right path, unfortunately you ran in to a bug in PyInstaller. The good news is that the issue with the No module named '_struct' error is now fixed and released in version 3.6 and later. I would recommend using the --onedir mode of PyInstaller, you should be able to successfully package a GTK app for Windows.
I have been attempting to learn PyQt5 in order to create GUI.
Pip installed the PyQt5 & the PyQt5.tools yet when I attempt to use it
using Visual Studio Code (while having the Python Extension of VS Code installed) I receive an error.
VS Code detects PyQt5 up to PyQt5.QtWidgets, yet it says no module inside QtWidgets named QApplication can be found.
Import Error of VS Code
On the contrary when it comes to the error, when I attempt to import QApplication from python.exe, no errors nor problems are presented.
Python.exe 'from PyQt5.QtWidgets import QApplication'
This leads me into thinking the problem resides at VS Code's doorstep..
Thanks for your time/answers.
open the cmd from start menu (Command Prompt)
type pip install pyqt5
type pip install pyqt5-stubs
install the integration of PyQt5 from VSCode Marketplace
if is it still not working try uninstalling PyQt5 (pip uninstall pyqt5)
and install it again
Search "PYQT Integration" on ur VS Code Extension shop
Install it
Set the configurations (ur pyqtdesigner path and pyuic etc)
this may help u
I had the same problem with lots of modules specially pytube . PyQt6 , It was all resolved when I changed my interpreter to python 3.11
I have built a GUI using PyQt5 and wanted to distribute it to other computers without Python installed by packageing it with pynsist. Unfortunately, when launching the shortcuts produced by the installer, the GUI does not open as expected and Python keeps crashing (even if Python is instlalled).
The console shows the following error upon crashing:
ModuleNotFoundError: No module named 'sip'.
This is due to from PyQt5.QtCore import *.
Unfortunately, when launching the .launch.py script on a computer with Python installed, everything works fine. I suppose this is because it then targets the installed version instead of the version included in the build of the GUI.
However, the shortcuts do not work, no matter if Python is installed, giving me the above error.
Any ideas how to fix this problem and make the shortcuts work on computers that do not have Python installed?
Thank you in advance!
When I first encountered this problem I simply added sip.pyd to my project-folder. You can find it under:
x:/path-to-python/Lib/site-packages/sip.pyd
but what realy solved my problem was using pyinstaller.
It automatically detects most dependencies and most of the time runs without complicated configurations.
pip install pyinstaller
pyinstaller main.py
# done
Sip is a separate package which PyQt5 requires. You can include it with your application by listing it in pypi_wheels=, as in the PyQt5 example:
[Include]
packages=listapp
pypi_wheels= PyQt5==5.6
sip==4.18
If you're using the latest version of PyQt5 (5.10.1), then the latest version of sip (4.19.8) should work with it.
I use python 3.4
I have downloaded PyQt4 from http://www.riverbankcomputing.com/software/pyqt/download
When i configure PyQt4 by running the following command.
python configure-ng.py
I get the following error:
Querying qmake about your Qt installation...
qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
Error: PyQt4 requires Qt v4.1.0 or later. Use the --qmake flag to specify the
correct version of qmake. If you are sure you are using Qt v4 then try the
configure.py script instead of this one.
Please can anyone help me with this..
I had difficulty getting to run but managed via documentation here: PyQt4 install problems on Ubuntu