So after installing the whole 5.5 Qt package, and installing SIP, and the Xcode command line tools, I get this problem when trying to install the PyQt folder i got from the .gz I downloaded from the website
Joshuas-MacBook-Pro-2:PyQt-gpl-5.5 Josh$ python configure.py -q /Users/Josh/Qt/5.5/clang_64/bin -d /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/
Querying qmake about your Qt installation...
sh: /Users/Josh/Qt/5.5/clang_64/bin: is a directory
Error: PyQt5 requires Qt v5.0 or later. You seem to be using v3. Use the
--qmake flag to specify the correct version of qmake.
However, I clearly have v5.5 of Qt.
Any idea how to fix this or type in a different command to install it directly?
After spending much time getting PyQt working smoothly on a Mac, my strong recommendation is to install PyQt via Homebrew. The steps are very simple:
1) Install homebrew from here
2) Edit your ~./bash_profile to include the following at the top, so that later installs will see the brew versions of installs:
export PATH=/usr/local/bin:$PATH
3) Refresh your terminal window:
>source ~/.bash_profile
4) Then, simply install python, sip, pyqt in that order:
>brew install python
>brew install sip
>brew install pyqt
You should now have a fully working python/pyqt environment that you can customize via pip etc.
Related
I am running django python2.7 using Pycharm in windows.
Now I have some issue with redis queue not working in windows because of this
I am trying to do what this person did here. Use a cygwin version of python as pycharm interpreter.
(not sure if I downloaded all the packages or did correct steps)
I downloaded cygwin and install packages python2.7 + python-setuptools and then try to point my Pycharm interpreter to c:/cygwin/bin/python27.exe
see image
After that it seem ok and ask me to install packing tools pip, I clicked it and it give me this error:
see image
"Cannot start process, the working directory '\cygdrive\c\Users\User1G~1.SIS\AppData\Local\Temp\1\tmpYpudf2pycharm-management\pip-7.1.0' does not exist"
According to the error message it looks like pip can't be found... Are you sure you have installed pip?
Take a look here, how you can install pip: Installing Pip-3.2 on Cygwin
You can open a cygwin command line window and try to manually install the packages you want to.
So I was looking around at different things to do on Python, like code for flashing text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you're not meant to copy them straight in, but one error I got was 'no module named wx'. I learned that I could get that module by installing wxPython. Problem is, I've tried all 4 options and none of them have worked for me. Which one do I download and how do I set it up using Windows?
Thanks
It's on PyPI. As of wxPython 4, Python 3 is supported.
Unfortunately, PyPI has a package called wx that is stuck at version 3.0.3; be sure to install the package named wxpython instead.
pip install wxpython
Please note that pip will automatically build wxWidgets for you, but it will not install wxWidgets system dependencies such as GTK and OpenGLu. If the above command exits with an error, look above for a message like this:
checking for <something>... not found
checking for <something>... no
configure: error: <prereq> libraries not available
Error running configure
ERROR: failed building widgets
This should give you information about at least one of the packages your system is missing.
The "official" list of prerequisites from the wxWidgets source is:
dpkg-dev
build-essential
libjpeg-dev
libtiff-dev
libsdl1.2-dev
libgstreamer-plugins-base0.10-dev # or 1.0 if available
libnotify-dev
freeglut3
freeglut3-dev
libsm-dev
libgtk-3-dev
libwebkitgtk-3.0-dev # or libwebkit2gtk-4.0-dev if available
libxtst-dev
The actual package names provided by your package manager may not match these exactly, and to be honest, I don't really know the best way to query a package manager to determine what packages provide the libraries you need.
3 steps to install wx-widgets and pygame in python IDLE
Install python 3xxx in your system opting (Add 3xxx to your path).
open python CLI to see whether python is working or not.
then open command prompt (CMD).
type PIP to see whether pip is installed or not.
enter command : pip install wheel
enter command : pip install pygame
To install wxpython
enter command : pip install -U wxPython
Thats all !!
As per home page instruction:
Make sure you have at least version 6.0.8 of pip and 12.0.5 for setuptools.
Install requirements for Linux as outlined in the readme.rst at:
https://github.com/wxWidgets/Phoenix/blob/master/README.rst
Install wxPython-Phoenix (Linux):
sudo pip install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Install wxPython-Phoenix (Windows, use the appropriate script folder):
C:\python27\scripts\pip.exe install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
I installed wxPython as part of the PsychoPy experiment builder dependencies, and had considerable trouble getting it to install properly as well initially. But this was what worked for me at the end. I use Ubuntu 16.04, python 3.5, pip3 19.0.3
pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython --user
If you use Conda then you may easily setup the environment with wx by one line:
$ conda create -n wxenv python=3 wxPython
Solving environment: done
## Package Plan ##
environment location: /home/user/.conda/envs/wxenv
added / updated specs:
- python=3
- wxpython
The following packages will be downloaded:
package | build
---------------------------|-----------------
[...]
Proceed ([y]/n)?
You need to ensure the versions of your wxPython download matches your installed python language library.
The current downloads wxPython downloads doesn't show any libraries built against python 3. I Believe the python 3 porting project is still ongoing.
If you are not sure of what you are doing I would stick with the 32bit version on windows as there are some Python libraries (ie IIRC, MySQLdb) which don't work with 64 bit python.
So you would then need to download python2.7 for windows x86 and "wxPython3.0-win32-py27 32-bit Python 2.7"
To install wxPython GUI library correctly go to the following page (https://wxpython.org/Phoenix/snapshot-builds/), which contains snapshots builds of wxPython library (Phoenix version) depending on your os and version of Python you want to work.
Then when you downloaded the proper package for your system and python version, simply install it by using pip. In my case I've choosen that one (wxPython_Phoenix-3.0.3.dev2811+ecc4797-cp36-cp36m-win_amd64.whl):
pip install wxPython_Phoenix-3.0.3.dev2811+ecc4797-cp36-cp36m-win_amd64.whl
To check that it has been installed sucessfully on the site-packages folder for your current python environment write:
pip freeze
It's all!
Check the version of wxpython and the version of python you have in your machine.
For python 2.7 use wxPython3.0-win32-3.0.2.0-py27 package
The problem was solved in openSuse simply with
zypper in python-wxWidgets-3_0-devel
Trying pip install before, gave me a lot of trouble (missing traits, missing wx/setup.h, https://github.com/wxWidgets/Phoenix/issues/1644, error: aggregate βwxGLAttributes _NullGLAttributesβ has incomplete type and cannot be defined, etc.).
wxpython failed to be installed with pipenv. Pipenv is not able to find wxpython binary so it tries to build wxpython but fails.
CXXFLAGS="-I/opt/homebrew/include" pipenv install wxpython
On my macOS M1 pipenv failed to install wxPython. After a lot of searching I found a forum post which really helped me fix the problem.
Source/Credits: https://forums.wxwidgets.org/viewtopic.php?t=47953&p=203709
Install current development version with:
pip install -U https://github.com/robotframework/RIDE/archive/master.zip
(python < 3.9) Install current Beta version (2.0b1) with:
pip install psutil
pip install -U --pre robotframework-ride
Note that I tried to install wxPython with 'pip install -U wxPython' as per instruction
with no avail. Too many errors to list here. π€¨
I found a solution to the problem!!
I'm working on a 64b machine and Windows 11 operating system using VSCode.
Here is the solution using PowerShell:
Version specs:
pip 22.3.1
virtualenv 20.15.1
python 3.10.8
Create a new virtual environment in the directory where the program resides and
activate. There must be no modules installed.
virtualenv venv
venv/scripts/activate.bat
Install the following in sequence:
pip install pygame
(Not sure why pygame must be installed first, but this was
recommended and it works) π
pip install -U wxPython
SUCCESS!!! π€
These are the modules installed:
numpy 1.24.1
Pillow 9.4.0
pip 22.3.1
pygame 2.1.2
setuptools 65.4.0
six 1.16.0
wheel 0.37.1
wxPython 4.2.0
VSCode still reports wx as a missing module even when you activate the virtual
environment within. Running the code from the PS command prompt within the virtual
environment is the only working solution.
PS. I am sure there are some conflicts when trying to install wxPython within an
environment where all the other modules are installed.
I am trying to install wxPython from src as I need the exact version 3.0.2.0 on Ubuntu. (So, I cannot follow the suggesion in the related question) I downloaded the source and did ./configure, make and make install. It seems to have ended without errors with the following message.
The installation of wxWidgets is finished. On certain platforms
(e.g. Linux) you'll now have to run ldconfig if you installed a
shared library and also modify the LD_LIBRARY_PATH (or equivalent)
environment variable. wxWidgets comes with no guarantees and
doesn't claim to be suitable for any purpose.
I confirmed my installation is not working by doing import wx & wx.version(). What needs to be done to complete the installation? Where should I set the LD_LIBRARY_PATH to?
Doing ./configure, make and make install only builds and installs wxWidgets. You also need to build wxPython using the build-wxpython.py script, which by default will also do the wxWidgets portion of the build for you, using known good configure flags. See wxPython/docs/BUILD.txt in the source tarball.
Try to check if wx is in sys.pah.
You can do it with this code
import sys
print sys.path
In output must be something like that /usr/lib/python2.7/dist-packages/wx
If not, adding path to wx folder to system path should solve your problem.
gtk3 should be install first
$sudo apt-get libgtk-3-dev
If you are facing problem to install wxpython on Python3 please use this command to install wxpython
$ pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython
By this command you can install latest wxPython4 version.
If you are using Windows or macOS
$ pip install -U wxpython
Older Version you can get from this link
https://sourceforge.net/projects/wxpython/files/wxPython/
I would like to install spyder (the math IDE for python, here 2.7) on my windows 8.1 machine.
I did install python starting from http://www.python.org/download/releases/2.7.6/;
I did install pip after having installed setuptools, following http://www.pip-installer.org/en/latest/installing.html for these installations;
I did change my path to add C:\Python27 and C:\Python27\Scripts to it, digging into the advanced parameters of my PC's properties. (By the way, I can't beleive the way you do this on windows has not changed for ages, with such a small input where you forgot to go at the end of the value when adding your path...)
I did install spyder
pip install spyder
But when launching it in command line (it's in the path :-) ), I ran through this error:
RuntimeError: Please check Spyder installation requirements:
PyQt4 4.4+ (or PySide 1.1.1+) is required.
Which is truly true. Though,
when trying to pip PyQt4 :
No distributions at all found for PyQt4
when trying to pip PySide, I have many errors, the root one seeming that it is unable to find nmake
Any piece of advice ?
To install PySide on Windows you can choose from the following options:
Download and install the packages from the releases page.
Use setuptools to install the egg binary packages:
c:> c:\Python27\Scripts\easy_install PySide
Use pip to install the wheel binary packages:
c:> c:\Python27\Scripts\pip install --use-wheel PySide
Details are here https://pypi.python.org/pypi/PySide#installing-pyside-on-a-windows-system
BTW: PyQt does not support setuptools or pip
I am not sure if its a proper answer, but you might want to take a look at PythonXY. It makes all these installation procedure a breeze.
From the details in your question, it looks like you are missing both PyQt4 and Qt itself.
There are binary installers for Windows available from the PyQt download page. These installers include both PyQt and Qt (as well as various other tools such as Qt Designer). The only things not included are the Qt documentation, and Python itself (which you seem to have already installed).
Just be careful to select the right installer from the list of Binary Packages: i.e. the one for Python-2.7, plus whatever architecture is appropriate for your system.
When I try installing the PyQt5 on Windows using the command
python configure.py
I get this error:
Error: Make sure you have a working Qt qmake on your PATH.
I got the pyQt5 from PyQt5 Download.
How can I install PyQt5?
Update:
I installed Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from the Qt Download page and now I have this error:
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
Error: Failed to determine the detail of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.
And when I execute the command python configure.py --verbose:
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
C:\Qt\Qt5.0.2\5.0.2\msvc2012_64\bin\qmake.exe -spec win32-msvc2008 -o qtdetail.m
k qtdetail.pro
nmake -f qtdetail.mk release
'nmake' nΓ£o Γ© reconhecido como um comando interno
ou externo, um programa operΓ‘vel ou um arquivo em lotes.
Error: Failed to determine the detail of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.
I added C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin (contains nmake.exe) to PATH and I got this error:
Querying qmake about your Qt installation...
Determining the details of your Qt installation...
C:\Qt\Qt5.0.2\5.0.2\msvc2012_64\bin\qmake.exe -spec win32-msvc2008 -o qtdetail.mk qtdetail.pro
nmake -f qtdetail.mk release
Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe" -f qtdetail.mk.Release
Microsoft (R) Program Maintenance Utility Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
cl -c -nologo -Zm200 -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32 -DQT_NO_DEBUG -DQT_CORE_LIB -I"..\..\..\..\..\..\..\Qt\Qt5.0.2\5.0.2\msvc2012_64\include" -I"..\..\..\..\..\..\..\Qt\Qt5.0.2\5.0.2\msvc2012_64\include\QtCore" -I"release" -I"..\..\..\..\..\..\..\Qt\Qt5.0.2\5.0.2\msvc2012_64\mkspecs\win32-msvc2008" -Forelease\ #C:\Users\Victor\AppData\Local\Temp\nm68EA.tmp
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.EXE"' : return code '0xc0000135'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe"' : return code '0x2'
Stop.
Mainly I use the following command under the cmd
pip install pyqt5
And it works with no problem!
The easiest way to install PyQt is to just use the installer (Link in your answer, step #5). If you install python 3.3, the installer will add all of the PyQt5 extras to that python installation automatically. You won't need to do any compiling (none of: nmake, nmake install, python configure).
All of the build options are available for if you need a custom install (for instance, using a different version of python, where there isn't an installer provided by riverbank computing).
If you do need to compile your own version of PyQt5, the steps (as you have found) are here, but assume you have python and a compiler installed and in your path. The installed and in your path have been where you have been running into trouble it seems. I'd recommend using the installer version, but you need to install python 3.3 first.
First try this in your Windows cmd window:
pip3 install pyqt5
If that is successful, it will look something like this:
C:\Windows\System32>pip3 install pyqt5
Collecting pyqt5
Downloading PyQt5-5.9-5.9.1-cp35.cp36.cp37-none-win_amd64.whl (77.2MB)
100% |################################| 77.2MB 13kB/s
Collecting sip<4.20,>=4.19.3 (from pyqt5)
Downloading sip-4.19.3-cp35-none-win_amd64.whl (49kB)
100% |################################| 51kB 984kB/s
Installing collected packages: sip, pyqt5
Successfully installed pyqt5-5.9 sip-4.19.3
If that did not work, you might try this link from SourceForge.
PyQt5 .exe installers for Windows
How to find the installer that's right for you?
First, determine what version of Python you have and whether you have 32-bit or 64-bit Python.
Next, open one of the directories. I'm on Python 3.5 64-bit so I'm looking for a .exe with those specs. When you open a directory on SourceForge, you will see some directories with ONLY .zip or .tar.gz. That's not what you're looking for. A good indication of which directory you should click is given by the "Downloads/Week" column.
I'll open the PyQt-5.6 directory in my case.
Here we notice some .exe files:
PyQt-5.6
|_PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x32-2.exe
|_PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x64-2.exe
|_PyQt5_gpl-5.6.zip
|_PyQt5_gpl-5.6.tar.gz
I know these are Python 3.5 by Py3.5 in the file name. I am also looking for the 64-bit version so I'll download PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x64-2.exe. Final answer!
Note: if you try to install a version that's not compatible with your system, a dialog box will appear immediately after running the .exe. That's an indication that you've chosen the wrong one. I'm not trying to sound like a dbag... I did that several times!
To test a successful install, in your Python interpreter, try to import:
from PyQt5 import QtCore, QtGui, QtWidgets
I found a partial solution...
Steps to install pyQt5 (with VS 2012) on Windows:
1) Install the binary file Qt 5.0.2 for Windows 64-bit (VS 2012, 500 MB) from here.
2) Get sip-4.14.7 (development snapshot) from here.
3) Extract the file and open the Developer Command Prompt for VS2012.
4) Execute these commands (in sip folder):
python configure.py
nmake
nmake install
5) Get the pyQt5 from here.
6) Extract the file and open the VS2012 x64 Native Tools Command Prompt.
7) Execute these commands:
python configure.py
UPDATE: When execute these commands below is not working:
nmake
nmake install
Solution: I will try use pyQt4 with Qt5... because pyQt5 is in development and doesn't have support/documentation yet.
I'm new to both Python and PyQt5. I tried to use pip, but I was having problems with it using a Windows machine. If you have a version of Python 3.4 or above, pip is installed and ready to use like so:
python -m pip install pyqt5
That's of course assuming that the path for Python executable is in your PATH environment variable. Otherwise include the full path to Python executable (you can type where python to the Command Window to find it) like:
C:\users\userName\AppData\Local\Programs\Python\Python34\python.exe -m pip install pyqt5
One of the most (probably the most) easiest way to install site-packages like PyQt5 is installing one of the versions of Anaconda. You can just install many of site-packages by installing it. List of avaliable site-packages with Anaconda versions can be checked here.
Dowload Anaconda3 or Anaconda2
Install it.
Add PyQt5's path inside Anaconda installation to your System Environment Variables.
For example:
PATH: ....; C:\Anaconda3\Lib\site-packages\PyQt5; ...
It is ready to use.
If you're using Windows 10, if you use
py -m pip install pyqt5
in the command prompt it should download fine. Depending on either the version of Python or Windows sometimes python -m pip install pyqt5 isn't accepted, so you have to use py instead. pip is a good way to download a lot of stuff, so I'd recommend that.
Another command under the cmd is:
easy_install pyqt5
If you have python installed completely, it can save you the hassle. All you need to do is enter the following command in your respective shell:
pip install pyqt5
And contrary to popular belief, AS LONG AS YOU HAVE PIP INSTALLED, you can do this on virtually any OS...
Hope this helped!
If you are facing problem with pip3 install pyqt5 then try pip3 install pyqt5==5.12.0
This solved the problem for me
It can be installed with below simple command:
pip3 install pyqt5
Download whl from here http://mirrors.aliyun.com/pypi/simple/pyqt5/
pip install PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl
If error comes try this
pip install --user PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl
Done
If you are using canopy, use the package manager to install qt (and or pyqt)
You can easily install it using Anaconda. At first install Anaconda or Miniconda on you system (download from here) and then install the pyqt as follow:
conda install pyqt
It works for both version of python (2 and 3).
To install the GPL version of PyQt5, run (see PyQt5 Project):
pip3 install pyqt5
This will install the Python wheel for your platform and your version of Python (assuming both are supported).
(The wheel will be automatically downloaded from the Python Package Index.)
The PyQt5 wheel includes the necessary parts of the LGPL version of Qt. There is no need to install Qt yourself.
(The required sip is packaged as a separate wheel and will be downloaded and installed automatically.)
Note:
If you get an error message saying something as
No downloads could be found that satisfy the requirement
then you are probably using an unsupported version of Python.
easiest way, I think download Eric, unzip go to sources, open python directory, drag the install script into the python icon, not folder, follow prompts
C:\Users\Digiline>python3 -m pip install pyqt5
Collecting pyqt5 Downloading PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl (6.8 MB) |ββββββββββββββββββββββββββββββββ| 6.8 MB 3.3 MB/s Collecting PyQt5-sip<13,>=12.8 Downloading PyQt5_sip-12.8.1-cp39-cp39-win_amd64.whl (63 kB) |ββββββββββββββββββββββββββββββββ| 63 kB 71 kB/s Collecting PyQt5-Qt5>=5.15 Downloading PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 MB) |ββββββββββββββββββββββββββββββββ| 50.1 MB 16 kB/s Installing collected packages: PyQt5-sip, PyQt5-Qt5, pyqt5
WARNING: The scripts pylupdate5.exe, pyrcc5.exe and pyuic5.exe are installed in 'C:\Users\Digiline\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed PyQt5-Qt5-5.15.2 PyQt5-sip-12.8.1 pyqt5-5.15.4
I was having issue due to spyder and the versions were colliding so I tried this
pip uninstall pyqt5
pip uninstall spyder
pip install spyder
This installed all!
In the command prompt type:
pip install pyqt5
i've the same issue, but i found out that my problem was linked to the environment variables, because the cmd could not find "pip"
i edited the variables and run the command
pip3 install pyqt5
and i managed to install pyqt5 without problem
Hope that could help
check this guide it is in italian but is easy
You can try running the following:
python3 -m pip install pyqt5
and if you want to use pytqt5-tools with designer you can try with:
python3 -m pip install pip install PySide2
Hello there you can get your answers from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/
To find your module press ctrl + f then type pyqt5
then click anyone of the file which matches your system related to
PyQt5
then after you download your module extract it to python >> lib >> site-packages. then extract it there
I m done with my Answer hope its helpfull