How to install PyQt5 in PyCharm?
I want PyQt5 in Pycharm. Can you explain in complete detail what should I do to install it?
6 Answers 6
pip install PyQt5 doesn’t work for PyCharm
![]()
Install PyQt5 from the installer on the PyQt website. It probably just installs PyQt as a site package to the python version you point to in your ‘Path’, although it may ask for your preference — cant remember.
It also installs other useful PyQt stuff to your hard drive.
It also updates the path to the PyQt module so you can easily run the pyuic5.bat file from the command line to convert the .ui generated by ‘Qt Designer’ to a python file.
No configuration of PyCharm should be necessary and it will pick up any new site packages added automatically.
The reason why you cannot pip install PyQt5 is because the Python Package Index (PyPi — where pip searches for packages) was not provided with the files to serve.
Put another way: when you use pip search , you are being provided with a list of projects that have been registered with PyPi, whether or not downloadable source files were made available.
Contrast the PyPi page for easyos, where a download of the files has been made available, to PyQt5, where they have not been.
Русские Блоги
Я уже устанавливал anaconda раньше, и он содержит pyqt.Поиск в среде, чтобы увидеть его, но для реальной разработки есть не все инструменты qt5, поэтому вам нужно установить его снова.
Запускаем в cmd:
Установите часто используемые инструменты Qt:
в C:\Users\Administrator\Anaconda3\Lib\site-packages Вы можете увидеть недавно установленный инструментарий и qt5 по пути:
Чтобы система могла распознавать часто используемые команды pyqt5-tools, путь установки необходимо добавить к пути переменной системной среды.
тип path можно увидеть:
Тест установки PyQt5
Если об ошибках не сообщается, значит, это правильно. Проверьте модули, от которых зависит PyQt5, и выполните следующую команду:
Настроить pycharm
Создайте новый проект, выберите интерпретатор, и интерпретатор установит для вас Python.В настоящее время вы можете увидеть в интерпретаторе PyQt5 и pyqt5-tools:
Затем в настройках нажмите внешние инструменты, нажмите " + ", нужно добавить Qt Designer с pyuic Два варианта.
На следующем рисунке показано содержимое нового окна Qt Designer:
Имя: Вы можете определить сами
программа: путь установки Qt Designer
параметр: не заполнять
directory: $ FileDir $
Как показано ниже:
На следующем рисунке показано содержимое нового окна pyuic:
Имя: Вы можете определить сами
программа: путь установки pyuic
parameter:$ FileName$ -o $FileNameWithoutExtension $.pydirectory: $ FileDir $
Как показано ниже:
После завершения вы можете открыть Qt Designer в pycharm.Это наша цель:
Откройте Qt Designer в это время, интерфейс будет следующим:
После создания простого интерфейса сохраните файл как test1.ui 。
Вы можете увидеть сгенерированный файл в левой части pycharm test1.ui
На этот раз нужно test1.ui Преобразование файла в .py Файл, удобный для просмотра pycharm, щелкните правой кнопкой мыши, чтобы выбрать External Tools ,Выбрать pyuic Чтобы преобразовать его:
Слева после преобразования вы можете увидеть:
Двойной щелчок test1.py Файл можно просмотреть:
Но файл в это время не может быть запущен, и соответствующие модули необходимо добавить до и после него:
Бег в это время test1.py File, вы увидите файл, созданный в Qt Designer только сейчас, как показано на рисунке ниже, реализованный .ui Файлы и .py Взаимное преобразование файлов.
Интеллектуальная рекомендация
Меч относится к предложению + 43: количество N сиша + Java
Оригинальное название: бросить кубики на землю, все точки кости сталкиваются с точкой точки кости. Введите n, напечатали вероятность всех возможных значений. (6 сторон каждой кости, точки от 1 до 6) Р.
![]()
Введение в Python 4
функция ввода Использование функции Функция input () является функцией ввода. Функция input () — это функция ввода. Когда вы пишете вопрос в скобках функции, функция input () будет отображать вопрос в.
Основные операции в R 01
Повторите основную операцию секретной книги ниндзя языка R учителя Се Иихуэй.
Мастерство, создание американской легенды очистки воды
Мастера — это не только технические специалисты и квалифицированные мастера, которые могут решить некоторые практические проблемы в производстве и жизни, но также авангарды, которые могут руководить п.
курсы памяти Лу Feifei (а, понимать память понимания мозга)
Понимание памяти, что память? Понимание памяти, что память? 1 Понимание мозга 2 Что такое память Функция 3 Память 3.1 общие воспоминания путь 3.2 Факторы, влияющие на память 4 запоминающий материал Че.
How to Integrate Qt Designer with Pycharm ?
In this post, we take a look at integrating Qt Designer and PyUIC with Pycharm using external tools option.
Rahul Vk July 5, 2022, 10:53 p.m.

PyQt is one of the most commonly used toolkit fir making GUI (Graphical User Interface) based programs in python. You can use Qt Designer tool to easily make GUIs using drag and drop functionality. After you design your GUI using QT Designer , you will get a .ui file which you can convert to .py using pyuic5. It is sometimes a little bit of hassle to do sll this. Luckily for us there exists a much easier way to do all this using PyCharm.
PyCharm is one of the most famous python IDEs and it has both free and a paid version. You can get PyCharm from Get PyCharm
First of all, lets start with installing pyqt5 and pyqt5-tools which contains the qt designer and other neccessary things.
To install pyqt5 , open command prompt and run pip install pyqt5 pyqt5-tools

After pyqt5 and pyqt5-tools is successfully installed, we can proceed to the next step that is configuring designer and pyuic as external tools in pycharm. For that open pycharm and go to file —> settings —> tools —> external tools.

Click on the plus button to add a new tool.
Fill in the details as follows:
- Name: QTdesigner
- Program: <write the path to your python installation folder here>\Scripts\pyqt5-tools.exe
- Arguments : designer
- Working directory: $ProjectFileDir$
Now click on ok and again press the plus button to add the next tool that is pyuic which we will use to convert our designer ui files to python .py files.

Fill in the details as follows
- Name : PyUIC
- Program: <your python installation folder>\Scripts\pyuic5.exe
- Arguments: -x $FileName$ -o $FileNameWithoutExtension$.py
- Working directory: $ProjectFileDir$
That's it. We have configured pyqt5 designer and pyuic as tools in pycharm.
Now to create a new gui , just go to designer tool

And the designer window will open

Create your UI and then click on save as and save the file with .ui extension.
After that you can see the .ui file you saved on your pycharm project window.
Just right click on the file select external tools —> PyUIC.

You will see a python file with the same name as the .ui file on your pycharm window.

You can modify that python file to add functionality to the GUI just created.
First, configure exTerNal Tools
Since Pycharm and Anaconda are basically a binding combination, in the installed Anaconda’s base environment contains PYQT5, we can first configure the External Tools, so there is no need to configure it again in future other projects. :
- Open any of your own project, open Setting Settings in the File directory:

- Locate External Tools under the Tools column, click "+", create the CREATE TOOL interface:

- Add "PyQt Designer" and "Pyuic" separately:
"Pyqt Designer" parameters:
Name:Pyqt designer
Description:for the realization of image visualization
Program: Library \ bin \ Designer.exe under anaconda3 directory
Working directory: $FileDir$
"Pyuic" parameters:
Name:PyUIC
Description:File of .ui to .py
Program: Python.exe under anaconda3 directory
Arguments: -m PyQt5.uic.pyuic $FileName$ -o $FileNameWithoutExtension$.py
Working directory: $FileDir$
Second, install PYQT5 pack in the project
To explain the first step: We just use the PYQT5 packets comes with the Conda’s Base environment when configuring External Tools. This is because after installing PYQT5 in your own project, it may have a full file is not complete. The situation, although it does not affect the code code, it is very impact on the link of External Tools.
Next, install the PYQT5 package in your own project, execute the command in your project environment:
Third, new UI file
We have new interfaces in the Pyqt Designer in External Tools:
- In any position in the project directory, find the PyQt Designer before you find us by the right-click menu bar:

Advance interface:
- Next, you can use PyQt to make the desired interface. The specific tutorial can search it yourself or find some specific cases of self-study, such as a calculator created with PYQT. The picture below is that I can use it according to my own needs, you can see it in the project directory after saving:


- In the UI file, find the Pyuic by right-click on the menu bar, convert it to the PY file:


- Click on the newly generated PY file, our visual interface has been converted to code form, put on the code of the PY file generated according to my UI file:
- The interface is there, then we need to give it true function, the next code can be written directly under this PY file, according to personal habits. I personally habits to create a PY file and reference the UI interface. Note that when writing the code below, pay attention to __init__ The various types of buttons in the section should correspond to the name under the UI file.
The following is posted for some code for your reference:
Reference UI interface and the library required:
Write the mainwindow class:
- After writing, run, the following is my interface run:

Fourth, conclude
At this point, we completed the basic configuration, installation, and simple apps for PYQT5. This article is a throwing jade, welcome friends to criticize and correct! After that, I will also update some small procedures you write, and the visualization features are implemented with PYQT5, you can do some references!