Python Forum

Full Version: pyside6 module not found
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I was writing a couple of programs under manjaro KDE. Now I've switched to ubuntu 23.04 and, when trying to run them, receive the following error:

ModuleNotFoundError: No module named 'PySide6'

Both programs have active venv. I also have a third program which used to work under manjaro but having the same problem now. Tried to create a virtual environment for it, but pip refuses to install pyside6 to it, claiming:

This environment is externally managed

Tried using pipx, which didn't help.

Any advise?

TIA
Sounds like you might have read this already:

https://itsfoss.com/externally-managed-environment/
Yes, but now I read it again. And again. Now it works, but just when running the program from command line. When opening it for editing/debugging in visual studio code it still doesn't work, saying "ModuleNotFoundError: No module named 'PySide6'". What am I missing?

TY
You need to configure VSCode to use your virtual environment.

https://code.visualstudio.com/docs/python/environments
Can also look at this post.
Quic demo of something i have posted before.
# Make environment
tom@tom:~$ python -m venv sci_env
tom@tom:~$ cd sci_env/
tom@tom:~/sci_env$ source bin/activate 

(sci_env) tom@tom:~/sci_env$ pip -V
pip 21.2.4 from /home/tom/sci_env/lib/python3.10/site-packages/pip (python 3.10)
(sci_env) tom@tom:~/sci_env$ pip install pyside6
Collecting pyside6
 .....
So now in VSCode i most choice 3.10(sci_env: venv).