ModuleNotFoundError: No module named 'PySide'

Hi.

I start Python course.
Now I have that a problem.
I try find something but still is that same.
Please help, thanks.

I using with fresh updates:
5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ModuleNotFoundError: No module named ‘PySide’

pip3 install PySide6
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: PySide6 in ./.local/lib/python3.10/site-packages (6.4.3)
Requirement already satisfied: shiboken6==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)
Requirement already satisfied: PySide6-Essentials==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)
Requirement already satisfied: PySide6-Addons==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)

Is PySide and PySide6 the same thing??? When looking at how to use PySide6, the imports in the code include PySide6… are you importing PySide?

Hi Piotr,
Welcome to Python and FCC.

It looks like you installed Pyside6 properly. You are getting: Requirement already satisfied messages, Good!

Commonly, first thing I do with a new python library is research it on https://pypi.org/
try: https://pypi.org/project/PySide6/

Next I went to: https://wiki.qt.io/Qt_for_Python

It looks like you are on the right path.
Just keep reading and keep going.

Blockquote

type or paste copython3 -m pip install “SomeProject”
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement SomeProject (from versions: none)
ERROR: No matching distribution found for SomeProject
python3 -m pip install “SomeProject==1.4”
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement SomeProject==1.4 (from versions: none)
ERROR: No matching distribution found for SomeProject==1.4
python3 -m pip install “SomeProject>=1,<2”
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement SomeProject<2,>=1 (from versions: none)
ERROR: No matching distribution found for SomeProject<2,>=1
python3 -m pip install “SomeProject~=1.4.2”
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement SomeProject~=1.4.2 (from versions: none)
ERROR: No matching distribution found for SomeProject~=1.4.2

Blockquote

Blockquote
pip install PySide6
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: PySide6 in ./.local/lib/python3.10/site-packages (6.4.3)
Requirement already satisfied: PySide6-Essentials==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)
Requirement already satisfied: shiboken6==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)
Requirement already satisfied: PySide6-Addons==6.4.3 in ./.local/lib/python3.10/site-packages (from PySide6) (6.4.3)

Blockquote

Blockquote
python setup.py install --qtpaths=/path/to/bin/qtpaths6 --parallel=8 --build-tests
Command ‘python’ not found, did you mean:
command ‘python3’ from deb python3
command ‘python’ from deb python-is-python3

Blockquote

Blockquote
Is PySide and PySide6 the same thing??? When looking at how to use PySide6, the imports in the code include PySide6… are you importing PySide?

Blockquote

Yes.

I mean, in your code, are you importing pyside6 or pyside? Could you share your code, is there a github link?

import sys
import random
from PySide import QtCore, QtWidgets, QtGui

class MyWidget(QtWidgets.QWidget):
def init(self):
super().init()

    self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"]

    self.button = QtWidgets.QPushButton("Click me!")
    self.text = QtWidgets.QLabel("Hello World",
                                 alignment=QtCore.Qt.AlignCenter)

    self.layout = QtWidgets.QVBoxLayout(self)
    self.layout.addWidget(self.text)
    self.layout.addWidget(self.button)

    self.button.clicked.connect(self.magic)

@QtCore.Slot()
def magic(self):
    self.text.setText(random.choice(self.hello))

if you installed PySide6, why is your import not:

from PySide6 import QtCore, QtWidgets, QtGui

Your error is saying it can’t find PySide… but you installed PySide6… that’s what I’ve been saying. I’ve never used these packages before, but from what I saw the PySide6 installation and use manual showed the imports are from PySide6.

Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type “help”, “copyright”, “credits” or “license()” for more information.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.