When trying to install qt4 for python 2.7 (that I need to run some scripts written by other developers):
$ sudo pip install PyQt4
Could not find a version that satisfies the requirement PyQt4 (from versions: )
No matching distribution found for PyQt4
Additional information:
$ python --version
Python 2.7.15+
$ pip list
Package Version
---------- -------
numpy 1.16.5
pip 19.3
pyqtgraph 0.10.0
setuptools 41.4.0
wheel 0.33.6
Any suggestion on how to install it?
Please note that I have tried the solution proposed here:
pip install PyQt4-4.11.4-cp35-none-win_amd64.whl
ERROR: PyQt4-4.11.4-cp35-none-win_amd64.whl is not a supported wheel on this platform.
I guess because it is not a windows platform, isn't it? I am trying to install it on XUbuntu 18.04.
As suggested in one of the comment by #phd "PyQt4-4.11.4-cp35-none-win_amd64.whl is for Python 3.5 and Python 64-bit. You need to download wheel for Python 2.7".
I have tryed also:
$ pip install PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl
Requirement 'PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl' looks like a filename, but the file does not exist
PyQt4‑4.11.4‑cp27‑cp27m‑win_amd64.whl is not a valid wheel filename.
So the question can be: how to install the right version? How to find the right packet? My problem is exactly this one: I do not know how to move myself in this big forest. Thank you for every suggestion.
Building on sinoroc's answer: PyQt4 is outdated, and only PyQt6 or PyQt5 are available on PIP. See this website.
pip install PyQt6
By default pip looks for project distributions on Pypi. If you ask for pip install PyQt4, then you can also manually look at the page for this PyQt4 project on PyPi. There you will eventually see that there are no distributions at all to download so pip won't be able to install anything on any platform for any Python version at all. You need to look for alternatives.
You can have a look at the homepage of the PyQt project and you will eventually find the page to download the PyQt4 source code. There is a link on this page for the Linux source code of PyQt4, so you might want to have a look at it and see if you can get it installed on your system.
Related
I'm trying to implement auto arima in my python 3.7 on Windows10 So I tried to install pyramid-armia using following command
pip install pyramid-arima
But I'm getting error message
Could not find a version that satisfies the requirement pyramid-arima (from versions: )]
No matching distribution found for pyramid-arima
I also tried steps mentioned here
But got the same error message
Can you please guide me to install it?
This error might be because there is no version of package that fits combination of versions of your Python, Operating System, Cpu Type and Instruction Set.
That package is out-dated and abandoned, hence not installable, use new replacement, which is pmdarima package:
pip install pmdarima
and import like:
import pmdarima
Official documentation for pmdarima is here.
If still you're getting same error for new pmdarima then download .whl package directly from here.
You need to download package corresponding to your python version and windows bits. E.g. if you have Python 3.7 and Windows 64-bit then download pmdarima-1.7.1-cp37-cp37m-win_amd64.whl (or with win32 suffix for 32-bit windows), here cp37 means CPython version 3.7.
Then just install it like this:
pip install pmdarima-1.7.1-cp37-cp37m-win_amd64.whl
Also many trouble-some Windows prebuild .whl packages that have problems with installation/compilation are located here. I've often downloaded this prebuilt packages from there, when haven't succeeded with pip install. But for the case of pmdarima it is located at the first link but not second.
Using Python 3.6.9 and pip 9.0.1 on Ubuntu Studio 18.04, I was trying to downgrade the PyQt5 module from version 5.10.1 to 5.9.2.
The installation seems to complete without a problem, but pip3 confirms that 5.10.1 was installed successfully:
pip3 install --no-cache-dir 'PyQt5==5.9.2'
Output:
Collecting PyQt5==5.9.2
Downloading https://files.pythonhosted.org/packages/3a/c6/26270f5550f00920045c2f0b222a7d03d7a64382825c68bf0bb1a51d854c/PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-abi3-manylinux1_x86_64.whl (105.3MB)
100% |████████████████████████████████| 105.3MB 11.0MB/s
Collecting sip<4.20,>=4.19.4 (from PyQt5==5.9.2)
Downloading https://files.pythonhosted.org/packages/8a/ea/d317ce5696dda4df7c156cd60447cda22833b38106c98250eae1451f03ec/sip-4.19.8-cp36-cp36m-manylinux1_x86_64.whl (66kB)
100% |████████████████████████████████| 71kB 4.2MB/s
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.10.1 sip-4.19.8
Checking the current version:
pip3 show PyQt5
Output:
Name: PyQt5
Version: 5.10.1
Summary: Python bindings for the Qt cross platform UI and application toolkit
Home-page: https://www.riverbankcomputing.com/software/pyqt/
Author: Riverbank Computing Limited
Author-email: info#riverbankcomputing.com
License: GPL v3
Location: /home/stragu/.local/lib/python3.6/site-packages
Requires: sip
I also tried uninstalling and installing it again, but I end up with version 5.10 (i.e. not 5.10.1) installed. It's like it forces version 5.10 as a minimum.
However, when I do the following in a Python3 kernel:
from PyQt5.Qt import PYQT_VERSION_STR
print("PyQt version:", PYQT_VERSION_STR)
I find out it is apparently using version 5.9.2!
Any idea what might be going on here?
It seems it is a problem with the default version of pip3 on this installation, version 9.0.1, which always reports (at the end of the install, or when listing the module versions with pip3 list) the module's highest version ever installed.
I upgraded pip3 with:
python3 -m pip install --upgrade pip
And it now works as expected, reporting the right module version number the user asked for (which matches whatever is retrieved when looking for the relevant module's version number from a Python3 kernel).
You are using your system's Python. This module is also installed system-wide with Apt. The strangeness in Pip's behaviour is due to a Debian patch.
I (blindly) guessed the 1st one by checking PyQt5 packages in Bionic which shows version number 5.10.1 that you see.
Examining the patches in the source archive for pip 9.0.1-2.3~ubuntu1.18.04.1 (available from https://launchpad.net/ubuntu/+source/python-pip/9.0.1-2.3~ubuntu1.18.04.1) shows the following relevant change in set_user_default.patch:
When running as a normal user in a non-virtual environment, default to
--user and --ignore-installed.
(I guess it's intended to fix UX for pip install here in comparison to earlier behavior which denied system-wide installation with a logical but obscure error.)
However, the patch only applies this to the install command.
So you install PyQt5-5.9.2 to user site -- while pip3 show shows you the package at the system site and you need to run pip3 list --user to see the latter.
I don't know why exactly pip3 install showed a wrong version at the end but guess that line is generated by the same code that powers pip3 show.
I try to install pyqt5-tools like this:
pip install pyqt5-tools
and the resulting out put is:
ERROR: Could not find a version that satisfies the requirement pyqt5-tools (from versions: none)
ERROR: No matching distribution found for pyqt5-tools
I need to download pyqt5-tools because I am trying to learn how to make GUIs with PyQt (I am a beginner programmer).
I have tried downloading different packages but anything related to PyQt has failed... It happens on both my Mac and Ubuntu machine.
I have checked that the packages are available on PyPI and literally copy-pasted the install command from the website into the terminal to make sure that I did not do it wrong.
Assuming you are installing that for qtdesigner. You can install it by package manager. I've installed it on my Debian machine
sudo apt install pyqt5-dev-tools pyqt5-dev
And you can find QtDesigner in
/usr/lib/x86_64-linux-gnu/qt5/bin/designer
If you are on windows use pip install PyQt5Designer instead.
You can download pyside2 it includes almost everything in pyqt5-tools; pyqt5, pyuic5 and the qdesigner
pip install PySide2
pyqt5-tools is only available for Windows as seen on their site: https://pypi.org/project/pyqt5-tools/
Try an alternative such as QT-creator for Mac: https://www.qt.io/download
This post strongly supports using Homebrew: Python PyQt on macOS Sierra
At first, if you are using python v3.10, probably, it won't work well.
when I have this error I uninstall python.
then install the python v3.9. it works better as it is older than v3.10
Best Solution I found
If you try to download pyqt5-tools it's not going to work with python v.3.10.x. But if you want to download it correctly you should try this solution because it works for me.
Install PyQt5:
pip install pyqt5
Install PyQt5Designer:
pip install PyQt5Designer
Then you should Find the Qt Designer, under the name designer.exe:
C:\...\Python\Python310\Lib\site-packages\QtDesigner\designer.exe
Note that the installation path of python may be different for you, to find yours, try this on your Python interpreter, type the following commands:
>>> import os, sys
>>> os.path.dirname(sys.executable)
'C:\\path-to-your-python-installation\\Python\\Python310'
Then you should find the QtDesigner after that path in for of:
C:\...\Python310\Lib\site-packages\QtDesigner\designer.exe
Just click on it, and pin it to your start or taskbar.
Or Simply if you want to download it directly as .exe, But I'm not sure if this can miss some pyqt5-tools:
Qt Designer Download
Go to Your python installation folder and find this followings:
Go here
Lib\site-packages\qt5_applications\Qt\bin
and you will find your qt designer
you should change your version from the newest version to a slightly old one, for example, 3.10 to 3.8 .
it is a normal thing when a new version is released, keep in mind that you have to update pip (using: python -m pip install --upgrade pip )
I want to install pyqt5 on python 2.7. I've tried to download on their website, but I can't open the website. I used:
pip install
and I got:
ERROR: Could not find a version that satisfies the requirement pyqt5 (from versions: none)
ERROR: No matching distribution found for pyqt5
You didn't mention an OS, but here is my experience with OSX - hopefully it is helpful to someone.
pyqt5 installed though pip appears to require python3 - and I couldn't find a way around it. After spending a bit of time trying to figure this out recently, there are two options I know of:
1) build from source, e.g. https://robonobodojo.wordpress.com/2017/02/08/installing-pyqt4-on-mac-osx/ , https://fredrikaverpil.github.io/2015/11/25/compiling-pyqt5-for-python-2-7-on-os-x/, for pyqt4 (just in case), pyqt5, respectively.
2) install using conda https://docs.conda.io/en/latest/miniconda.html
I was unable to get 1) working for me (on OSX 10.14.5) due to, I believe, an issue with paths configuration. But conda worked immediately. Once installed (by choosing the python2 install), just do conda install pyqt.
edit: there is also an Ubuntu guide for building from source here : https://plashless.wordpress.com/2014/03/26/building-pyqt5-for-python2-7-on-a-clean-ubuntu-13-10-build-machine/
pyqt5 requires python 3.4 or later
I am trying to install PyQt5 on my Mac but I do not know how to use it well. I have tried to install sip doing
cd ~/Downloads/sip-4.17
python configure.py
which worked, and then I tried
cd ~/Downloads/PyQt-gpl-5.5.1
python configure.py --qmake /Users/name/Qt/5.5/clang_64/bin/qmake
which returns an error that says
Make sure you have a working sip on your PATH or use the --sip argument to explicitly specify a working sip.
How do I fix this error? Did I not install sip?
Meanwhile I have the ultimate way to install PyQt5 on macOS.
Don't use Homebrew. It is great for installing Qt5, but for PyQt5 the best way to install it is using
python3 -m pip install PyQt5
This works very quickly and uses universal Python Wheels:
Collecting PyQt5
Downloading PyQt5-5.9-5.9.1-cp35.cp36.cp37-abi3-macosx_10_6_intel.whl
(82.2MB)
100% |████████████████████████████████| 82.2MB 17kB/s
Collecting sip<4.20,>=4.19.3 (from PyQt5)
Downloading sip-4.19.3-cp36-cp36m-macosx_10_6_intel.whl (49kB)
100% |████████████████████████████████| 51kB 1.2MB/s
Installing collected packages: sip, PyQt5
Successfully installed PyQt5-5.9 sip-4.19.3
You see: Such a wheel is re-used for CPython 3.5, 3.6 and 3.7.
Old remark, but see below: PySide2 is not as far, but we will build similar wheels when we have the first version ready.
Added on 2017/09/25: You can of course also use
pip3 install PyQt5
But at that time my pip/pip2/pip3 was a bit messy linked, so the first solution is rock solid and avoids confusion.
Also right is that you don't always get the lastest version of PyQt5 this way. But for getting started, the priority is to get results quickly and not the bleeding edge.
Update: PySide2 now officially has wheels, to:
$ python3 -m pip install PySide2
Collecting pyside2
Downloading https://files.pythonhosted.org/packages/2a/e2/2dc134a5c475f661d5ff2ab587fbd2c285db3d064e03ac9b4a2ee0958400/PySide2-5.12.2-5.12.2-cp35.cp36.cp37-abi3-macosx_10_12_intel.whl (109.8MB)
100% |████████████████████████████████| 109.8MB 238kB/s
Collecting shiboken2==5.12.2 (from pyside2)
Downloading https://files.pythonhosted.org/packages/bd/8b/a2ad76c3a935fae51f0ed9b150a9df08167c4550fcd07637f0db19c31849/shiboken2-5.12.2-5.12.2-cp35.cp36.cp37-abi3-macosx_10_12_intel.whl (691kB)
100% |████████████████████████████████| 696kB 1.6MB/s
Installing collected packages: shiboken2, pyside2
Successfully installed pyside2-5.12.2 shiboken2-5.12.2
If you see bugs or differences between the two, please feel free to open a bug report. Follow the instructions on https://wiki.qt.io/Qt_for_Python/Reporting_Bugs
I'm kind of dodging the question, but the simplest way is to install Homebrew, and just run brew install pyqt or brew install pyqt5.
You need to install SIP first, which is not just running configure.py:
>>> cd ~/Downloads/sip-4.17
>>> python configure.py
>>> make
>>> make install
Then you can install PyQt5:
>>> cd ~/Downloads/PyQt-gpl-5.5.1
>>> python configure.py --qmake /Users/name/Qt/5.5/clang_64/bin/qmake
>>> make
>>> make install
Qt is set of cross-platform C++ libraries that implement high-level APIs for accessing many aspects of modern desktop and mobile systems. These include location and positioning services, multimedia, NFC and Bluetooth connectivity, a Chromium based web browser, as well as traditional UI development.
PyQt5 is a comprehensive set of Python bindings for Qt v5. It is implemented as more than 35 extension modules and enables Python to be used as an alternative application development language to C++ on all supported platforms including iOS and Android.
PyQt5 may also be embedded in C++ based applications to allow users of those applications to configure or enhance the functionality of those applications.
brew install PyQt5 (or) pip3 install PyQt5
In ~/.pip/pip.log I discovered:
Skipping https://pypi.python.org/packages/... (from https://pypi.python.org/simple/pyqt5/) because it is not compatible with this Python
Simply installed newwer version of Python 3 from official website and pip3 install PyQt5 finally worked.
Qt has a Mac .dmg installer with all the components. I uninstalled my pip version first, and installed my Qt into the standard location - I tried putting into /opt/Qt as suggested by another post, but it failed due to changes to MacOS rights in Mojave. There is an expansion triangle next to the Qt item which allows for installing Designer separately from the Qt engine and the 2D/3D development and platform-specific tools.
Qt Installer:
https://www.qt.io/download-qt-installer