I’m newer to Python. You didn’t mention your OS, so on Windows your path could be the issue here.
On Windows I had to change my path in my CLI (cmd.exe) to point to 3 different Python directories.
c:\users\USERNAME\AppData\Local\Programs\Python\Python39;
c:\users\USERNAME\AppData\Local\Programs\Python\Python39\scripts;
c:\users\USERNAME\AppData\Local\Programs\Python\Python39\lib
Also I use a virtual environment. You will need to learn about this. But if you’re doing a tutorial, like from Udemy, it can be confusing as some longer tutorials use various version of Python as they update the tutorial over time.
Virtual environment basics.
- Install the virtual env with
py -m pip install virtualenv - Make a project folder, let’s call this “proj1”.
- Using your CLI go into folder “proj1”.
- Init the virtual env in your “proj1” with
virtualenv .venv. This creates a folder in your proj1 dir called “.venv”. - Activate your virtual env by typing
.venv\scripts\activate. There are scripts for every OS under.venv\scripts\. - Install your other modules like PyQt.
- Begin programming in this “proj1” project.
- When done programming or switching to another program folder, deactivate your environment with
.venv\scripts\deactivate.
Someone correct me if I’m wrong but each of your projects will have it’s own modules installed.