Score:1

How to use pyside2 from the Ubuntu repository to develop programs?

br flag
123

When I run apt search pyside packages I get for example:

python3-pyside2.qtwidgets/focal 5.15.2-1+20.04+focal+release+build1 amd64

When I install it, how can I use it with my python-programm? Do I need to package my python-programm as .deb? How does it work and what do I need to consider?

Score:1
us flag

Installing python3-pyside2.qtwidgets alone may not be enough. Install all the following packages instead.

sudo apt install python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtwidgets python3-pyside2.qtnetwork

When I install it, how can I use it with my python-programm?

You just need to import appropriate libraries. Example:

from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
    QRect, QSize, QUrl, Qt)

Do I need to package my python-programm as .deb?

If you want to use it yourself, then no.

If you want to distribute it, then you can either upload to PyPI and ask people to install from pip, or package it as .deb and distribute (alternatively, if the program is simple enough, just distribute the source, and ask users to install PySide2 manually).

123 avatar
br flag
123
Okay I will go ahead and give it a try(I think there is something wrong with my installation). Thank you for your answer!
us flag
@123 Check the updated answer.
123 avatar
br flag
123
I go ahead and check it as answered, when I get it running. If I shouldn't get it running I will come back and ask again.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.