2.5.2.2 Installing PyQt6

In contrast to tkinter, PyQt6 is not part of the Python standard library and may or may not be available to install through Pro's Package Manager. We can though, use the Package Manager to clone the default environment and use the Python Command Window to install the packages we need.

Create another clone of the default environment, giving it a name such as arcgispro-py3-pyqt and activate it. You can check the Installed Packages list to see if pyqt is installed at this time, but more likely it will not be installed. If it is not installed, go to Add Packages and type "pyqt".  It may not be listed as a package to add in this curated list by esri's included version of conda so we will need to use the Python Command prompt to install the package. There are two quick ways to start a command window in your py3-pyqt conda environment:

In your Windows start menu:

Windows start menu highlighted

search for "Python Command Prompt" and it should result in a "Best match". After opening, be sure to verify that it opened the environment you want to work in (details below).

Python Command Prompt search and highlighted

Or, you can navigate to it by clicking the "All" to switch to the application list view.

All drop down highlighted

Scroll down the list and expand the ArcGIS folder to list all ArcGIS applications installed.

ArcGIS program folder highlighted

Scroll down and open the Python Command Prompt.

Python Command Prompt highlighted

This is a shortcut to open a command window in the activated python environment. Once opened, you should see the environment name in parentheses followed by the full path to the python environment.

Conda env name highlighted

When you change your activated environment in Pro's Package Manager, this shortcut will also be updated to point to that activated environment.

Type 'pip install PyQt6 PyQt6-WebEngine PyQt6-tools' without the quotes and hit enter.

pip command typed in

Proceed through the prompts and if this does not install, please let your instructor know. When it completes, you probably now have version 6.8.0 or later of pyqt installed. Next, try to run the test code on the next page. Let your instructor know if you are not able to run the application.