qt6 designer in python [duplicate] - python

Feeling really stupid, right now, but the title says it all:
How do you start the QtDesigner?
I've installed PyQt5 via pip and I believe to have identified the directory it's been installed in as
C:\Users\%username%\AppData\Local\Programs\Python\Python36\Lib\site-packages\PyQt5
Now what? There are a lot of .pyd files, some .dll's, too, but nothing executable (well, except a QtWebEngineProcess.exe in ...\site-packages\PyQt5\Qt\bin, but that doesn't sound like what I'm looking for.

I struggled with this as well. The pyqt5-tools approach is cumbersome so I created a standalone installer for Qt Designer. It's only 40 MB. Maybe you will find it useful!

If you are working in python virtual environment, in the command window
>>qt5-tools designer
can open designer window.

The latest PyQt5 wheels (which can be installed via pip) only contain what's necessary for running applications, and don't include the dev tools. This applies to PyQt versions 5.7 and later. For PyQt versions 5.6 and earlier, there are binary packages for Windows that also include the dev tools, and these are still available at sourceforge. The maintainer of PyQt does not plan on making any further releases of such binary packages, though - only the runtime wheels will now be made available, and there will be no official wheels for the dev tools.
In light of this, someone has created an unofficial pyqt5-tools wheel (for Windows only). This appears to be in it's early stages, though, and so may not keep up with recent PyQt5 releases. This means that it may not always be possible to install it via pip. If that is the case, as a work-around, the wheel files can be treated as zip files and the contents extracted to a suitable location. This should then allow you to run the designer.exe file that is in the pyqt5-tools/designer folder.
Finally, note that you will also see some zip and tar.gz files at sourceforge for PyQt5. These only contain the source code, though, so will be no use to you unless you intend to compile PyQt5 yourself. And just to be clear: compiling from source still would not give you all the Qt dev tools. If you go down that route, you would need to install the whole Qt development kit separately as well (which would then get you the dev tools).

The Qt designer is not installed with the pip installation.
You can either download the full download from sourceforge (probably won't be the last pyqt release, and might be buggy on presence of another installation, like yours) or install it with another (unofficial) pypi package - pyqt5-tools (pip install pyqt5-tools), then run the designer from the following subpath of your python directory -
...\Python36\Lib\site-packages\pyqt5-tools\designer\designer.exe

pip install pyqt5-tools
Then restart the cmd, just type "designer" and press enter.

If you cannot see the Designer , just look into this path "Lib\site-packages\qt5_applications\Qt\bin" for designer.exe and run it.

PyQt5 works after pip install PyQt5Designer

pip install pyqt5-tools
working in python 3.7.4
wont work in python 3.8.0

You can also install Qt Designer the following way:
Install latest Qt (I'm using 5.8) from Qt main site
Make sure you include "Qt 5.8 MinGW" component
Qt Designer will be installed in C:\Qt\5.8\mingw53_32\bin\designer.exe
Note that the executable is named "designer.exe"

For anyone stumbling across this post in 2021+ and finding the answers outdated: QT Designer is now in the qt5-applications package, under Qt\bin\. On Windows this means the default path, for CPython 3.9 using the Python.org installer, is %APPDATA%\Python\Python39\site-packages\qt5_applications\Qt\bin\designer.exe.

Download the module using pip:
pip install PyQt5Designer
Then, for anaconda users, open:
C:\ProgramData\AnacondaX\Lib\site-packages\QtDesigner\designer.exe
For python users:
64-bit:
C:\Program Files\PythonXX\Lib\site-packages\QtDesigner\designer.exe
32-bit:
C:\Program Files (x86)\PythonXX\Lib\site-packages\QtDesigner\designer.exe

Try using:
pip install pyqt5-tools
Now you'd find the designer in site-packages/pyqt5-tools.

If you are installing the pyqt5-tools then you can find the designer.exe file inside:
<python_installation>\Lib\site-packages\Qt
If you cannot locate the file or have any issues opening this directly, then open a command prompt and type:
<python_installation>\Scripts\pyqt5designer.exe

For Qt Designer 6 this worked for me thanks for that protip from #Bhaskar
pip install pyqt6-tools
Then started:
qt6-tools designer
End up with nice working lightweight Qt Designer 6.0.1 version
# pip install pyqt6-tools
Collecting pyqt6-tools
Using cached pyqt6_tools-6.1.0.3.2-py3-none-any.whl (29 kB)
Collecting pyqt6-plugins<6.1.0.3,>=6.1.0.2.2
Downloading pyqt6_plugins-6.1.0.2.2-cp39-cp39-manylinux2014_x86_64.whl (77 kB)
|████████████████████████████████| 77 kB 492 kB/s
Collecting python-dotenv
Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB)
Collecting pyqt6==6.1.0
Downloading PyQt6-6.1.0-cp36.cp37.cp38.cp39-abi3-manylinux_2_28_x86_64.whl (6.8 MB)
|████████████████████████████████| 6.8 MB 1.0 MB/s
Requirement already satisfied: click in ./.pyenv/versions/3.9.6/lib/python3.9/site-packages (from pyqt6-tools) (8.0.1)
Collecting PyQt6-sip<14,>=13.1
Downloading PyQt6_sip-13.2.0-cp39-cp39-manylinux1_x86_64.whl (307 kB)
|████████████████████████████████| 307 kB 898 kB/s
Collecting PyQt6-Qt6>=6.1.0
Using cached PyQt6_Qt6-6.2.2-py3-none-manylinux_2_28_x86_64.whl (50.0 MB)
Collecting qt6-tools<6.1.0.2,>=6.1.0.1.2
Downloading qt6_tools-6.1.0.1.2-py3-none-any.whl (13 kB)
Collecting click
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 381 kB/s
Collecting qt6-applications<6.1.0.3,>=6.1.0.2.2
Downloading qt6_applications-6.1.0.2.2-py3-none-manylinux2014_x86_64.whl (80.5 MB)
|████████████████████████████████| 80.5 MB 245 kB/s
Installing collected packages: qt6-applications, PyQt6-sip, PyQt6-Qt6, click, qt6-tools, pyqt6, python-dotenv, pyqt6-plugins, pyqt6-tools
Attempting uninstall: click
Found existing installation: click 8.0.1
Uninstalling click-8.0.1:
Successfully uninstalled click-8.0.1
Successfully installed PyQt6-Qt6-6.2.2 PyQt6-sip-13.2.0 click-7.1.2 pyqt6-6.1.0 pyqt6-plugins-6.1.0.2.2 pyqt6-tools-6.1.0.3.2 python-dotenv-0.19.2 qt6-applications-6.1.0.2.2 qt6-tools-6.1.0.1.2

you should find it here if your using anaconda
C:\Users\%username%\anaconda3\envs\untitled\Lib\site-packages\qt5_applications\Qt\bin

By far the easiest way to do this is to use this installer:
https://build-system.fman.io/qt-designer-download
It seems as though the other answers here are now out of date, not to mention confusing for someone who is just starting out with this. Sourceforge no longer has this package, I installed the tools as suggested but nothing appeared in the scripts folder, and none of the pip commands above worked either.

I was having the same problem, however I was able to install using the Pygame module installation code, changing some information:
pygame:
py -m pip install -U pygame --user
PyQt5:
py -m pip install -U pyqt5-tools --user

In a Windows' terminal, activate your virtual env where you have installed PyQt5 then just type designer.
You can create a shortcut by finding its path with where designer

Related

pip uninstall - what is getting deleted?

I have a pipeline using biopython. I installed a different software that also uses biopython, and it overwrote my existing biopython version to give me the latest version. Some bits of my pipeline now no longer work, I suspect because they use deprecated elements of the earlier biopython pipeline that are no longer useable.
I would therefore like to uninstall biopython and reinstall an earlier version.
When I do pip uninstall biopython, this comes up in my command prompt:
C:\Users\u03132tk>pip uninstall biopython
Uninstalling biopython-1.79:
Would remove:
c:\anaconda3\lib\site-packages\bio\*
c:\anaconda3\lib\site-packages\biopython-1.79.dist-info\*
c:\anaconda3\lib\site-packages\biosql\*
Would not remove (might be manually added):
c:\anaconda3\lib\site-packages\bio\profiler.py
c:\anaconda3\lib\site-packages\bio\~aps\__init__.py
.....many more paths
As I understand, * is a wild card. Wouldn't removing c:\anaconda3\lib\site-packages\bio\* (first removed path) remove all of the paths under Would not remove that are prefixed with c:\anaconda3\lib\site-packages\bio?
I'm just trying to clarify what it's doing.
Cheers for reading!
c:\anaconda3\lib\site-packages\bio\profiler.py
c:\anaconda3\lib\site-packages\bio\~aps\__init__.py
These files are not part of a standard biopython installation. ~aps looks odd. Possibly a previous installation was killed half-way and now your biopython installation is broken?
That being said, you are right that c:\anaconda3\lib\site-packages\bio\* would include c:\anaconda3\lib\site-packages\bio\profiler.py. The output is a little confusing here. All files listed under Would not remove (might be manually added): will be kept. Note however that for a clean biopython installation there would be no such entries:
(py39) C:\>pip install biopython
Collecting biopython
Using cached biopython-1.79-cp39-cp39-win_amd64.whl (2.3 MB)
Collecting numpy
Using cached numpy-1.23.2-cp39-cp39-win_amd64.whl (14.7 MB)
Installing collected packages: numpy, biopython
Successfully installed biopython-1.79 numpy-1.23.2
(py39) C:\>pip uninstall biopython
Found existing installation: biopython 1.79
Uninstalling biopython-1.79:
Would remove:
c:\miniconda3\envs\py39\lib\site-packages\bio\*
c:\miniconda3\envs\py39\lib\site-packages\biopython-1.79.dist-info\*
c:\miniconda3\envs\py39\lib\site-packages\biosql\*
Proceed (Y/n)? y
Successfully uninstalled biopython-1.79
(py39) C:\>
So I would suggest that after uninstalling, you just remove all remaining files in the BIO folder.
Proof that they are kept
One can reproduce the message you get by just adding a custom file in the BIO folder after installation:
(py39) C:\>pip install biopython
Collecting biopython
Using cached biopython-1.79-cp39-cp39-win_amd64.whl (2.3 MB)
Requirement already satisfied: numpy in c:\miniconda3\envs\py39\lib\site-packages (from biopython) (1.23.2)
Installing collected packages: biopython
Successfully installed biopython-1.79
(py39) C:\>type nul >> C:\miniconda3\envs\py39\lib\site-packages\Bio\profile.py
(py39) C:\>pip uninstall biopython
Found existing installation: biopython 1.79
Uninstalling biopython-1.79:
Would remove:
c:\miniconda3\envs\py39\lib\site-packages\bio\*
c:\miniconda3\envs\py39\lib\site-packages\biopython-1.79.dist-info\*
c:\miniconda3\envs\py39\lib\site-packages\biosql\*
Would not remove (might be manually added):
c:\miniconda3\envs\py39\lib\site-packages\bio\profile.py
Proceed (Y/n)? y
Successfully uninstalled biopython-1.79
(py39) C:\>dir c:\miniconda3\envs\py39\lib\site-packages\bio
Volume in drive C has no label.
Volume Serial Number is F060-053A
Directory of c:\miniconda3\envs\py39\lib\site-packages\bio
18/08/2022 15:16 <DIR> .
18/08/2022 15:16 <DIR> ..
18/08/2022 15:16 0 profile.py
1 File(s) 0 bytes
2 Dir(s) 35.953.205.248 bytes free
(py39) C:\>
Side Note
biopython is part of the anaconda distribution, so using pip install in the base env will have overwritten a package installed via conda using pip, which is bad practice and can cause inconsistencies in your environment. I would suggest modifying an anaconda base env as little as possible. Instead, you could create an environment that holds all the packages that you need for your pipeline to run stably. You can even have a .yml file specifying the required package versions so that you can easily recreate it. This has the advantage that if your experiments lead you to a broken state, you can just recreate the environment (which is a lot more of a pain for the anaconda base with >600 packages)

installing Brain Scaffold Builder with broken rtree dependency

I have recently installed NEST on my MAC. I have to install the Brain Scaffold Builder. I followed the instructions and wrote bsb==3.6.0b6 and I received the following error message
Using cached bsb-3.6.0b6-py3-none-any.whl (189 kB)
ERROR: Could not find a version that satisfies the requirement rtree-linux==0.9.4 (from bsb)
ERROR: No matching distribution found for rtree-linux==0.9.4
Could you please help me to fix it?
Thank you very much in advance for your help.
The rtree package did not come packaged with wheels before version 0.9.6 (see PR#163) and the BSB instead published it's own version of the wheels under the name rtree-linux as it only contained Linux wheels and later Windows wheels. Mac wheels had never been available up until PR#163 a month ago or so.
You can resolve this issue by either cloning the repository and adapting setup.py to install rtree>=0.9.7 or by asking the maintainer (disclaimer: me) to do so; I have done so and you should be able to install the BSB with version 3.6.1 (pip install bsb) as of now on Mac without special efforts and it will use the rtree==0.9.7 Mac wheels.

Matplotlib is processing but could not download using pip

C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install matplotlib
Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0a
a09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.
whl
C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install --no-cache-dir matplotlib
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages/b1/56/569c83515c10146fd0aa
09e086816b12e301d0811048e3354a6e9b77ba9a/matplotlib-3.0.2-cp36-cp36m-win_amd64.w
hl (8.9MB)
100% |████████████████████████████████| 8.9MB 12.8MB/s
C:\Users\Sheetal1.Jain\AppData\Local\Programs\Python\Python36\Scripts>pip install matplotlib==1.5.1
Collecting matplotlib==1.5.1
Downloading https://files.pythonhosted.org/packages/8f/f4/c0c7e81f64d5f4d36e52
e393af687f28882c53dcd924419d684dc9859f40/matplotlib-1.5.1.tar.gz (54.0MB)
100% |████████████████████████████████| 54.0MB 18kB/s
I have tried the above 3 versions to install matplotlib package in python 3.6 but after complete processing, the exe file is not seen in the folder. It does not display any error so I cannot understand where the problem lies.
import matplotlib
raises error
Module Not Found Error
Open cmd as administrator and type : pip3 install matplotlib
At a guess I would say you're not installing to the correct library that is being used by the python interpreter.
Do you have Anaconda installed?
If so you will need to install packages using conda install to install packages.

qscintilla python binding issue

Attempting to follow the QSCintilla instructions re Python bindings for PyQT5
Python Bindings
The Python bindings are in the Python directory. You must have either PyQt v4 or v5 already installed. QScintilla must also already be built and installed.
The configure, build and install the bindings for PyQt v4, run:
python configure.py
make
make install On Windows (and depending on the compiler you are using) you may need to run nmake rather than make.
If you want to build the bindings for PyQt v5 then pass –pyqt=PyQt5 as an argument to configure.py.
But when I run the below command it complains about PyQt5 not being installed
python configure.py --qmake=/users/marklloyd/Qt/5.8/clang_64/bin/qmake --pyqt=PyQt5
Error: Unable to import PyQt5.QtCore. Make sure PyQt5 is installed
If I run brew info I can see the dependency is OK
brew info qscintilla2
qscintilla2: stable 2.10 (bottled) Port to Qt of the Scintilla editing component https://www.riverbankcomputing.com/software/qscintilla/intro /usr/local/Cellar/qscintilla2/2.10 (135 files, 6.9MB) * Poured from bottle on 2017-03-21 at 13:54:46 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/qscintilla2.rb
==> Dependencies Required: qt5 ✔, sip --with-python3 ✔, pyqt5 ✔
==> Requirements Recommended: python3 ✔ Optional: python ✔
==> Options
--with-plugin Build the Qt Designer plugin
--with-python Build Python bindings
--without-python3 Do not build Python3 bindings
this is OSX 10.12.3 FYI and I am more than happy to admit I'm not an expert at this level of stuff at all.
I'm trying to get QScintilla working so I can get PyMakr from Pycom installed and working
Pymakr-master marklloyd$ python install.py
Checking dependencies
Python Version: 2.7.12
Found PyQt5
Found pyuic5
Sorry, please install QScintilla2 and
its PyQt5/PyQt4 wrapper.
Error: cannot import name Qsci
Anyone else suffered similar issues?
To answer Barrys comment
pip3 install QScintilla returns
Requirement already satisfied:
QScintilla in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages
Requirement already satisfied: PyQt5>=5.7.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages (from QScintilla)
Requirement already satisfied: sip<4.20,>=4.19 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python‌​3.6/site-packages (from PyQt5>=5.7.1->QScintilla)
pip3 install pyqt5
Requirement already satisfied: pyqt5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requirement already satisfied: sip<4.20,>=4.19 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from pyqt5)

Pip is not installing any libraries

I have been trying to install numpy using pip on Windows.
But it doesn't seem to be working.
I tried installing numpy and t told me that microsoft C++ package is missing and asked me to install it. I did that and tried re-installing numpy. But this time it doesn't seems to work. It doesn't seem to forward after this point
C:\Users\neil>pip install numpy
Collecting numpy
Using cached numpy-1.9.1.tar.gz
Running from numpy source directory.
Installing collected packages: numpy
Running setup.py install for numpy
Then I tried installing scipy, even that doesn't seem to move forward after this point.
C:\Users\neil>pip install scipy
Collecting scipy
Downloading scipy-0.14.1.tar.gz (10.9MB)
100% |################################| 10.9MB 284kB/s ta 0:00:01
You could use Anaconda. Anaconda is a completely free Python distribution (including for commercial use and redistribution). It includes over 195 of the most popular Python packages for science, math, engineering, data analysis (including numpy and scipy).
After downloading the Anaconda installer, double click on the installer application icon and run it.
Follow the instructions in the installer.
The installer is also capable of running in silent mode, without bringing up the graphical interface. To install Anaconda, type the following command into a command prompt:
> Anaconda-2.x.x-Windows-x86[_64].exe /S /D=C:\Anaconda
Good luck.

Categories