LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Python problem (https://www.linuxquestions.org/questions/linux-software-2/python-problem-4175668625/)

business_kid 01-29-2020 07:25 AM

Python problem
 
No python expert here. I'm trying to install openshot, a python-heavy application. I found Slackware64 -Current precompiled packaged on the ponce.cc website and installed them on my Slackware64-Current system. Slackware does not do dependency tracking. It's easier overall, but can be a pain occasionally.

First run, it complained for the lack of 'PyQt5' and 'classes' modules. I installed them with pip3, but made the mistake of doing it as a luser, so it put them in /home/user/.local/bin, which didn't solve things. So I installed them as root, but it preferred the user versions :/

Then I uninstalled them all, installed as root, and that satisfied PyQt5, but it still bellyaches over the classes module thusly
Code:

bash-5.0$ openshot-qt
Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/openshot_qt/launch.py", line 47, in <module>
    from classes import info
ImportError: cannot import name 'info' from 'classes' (/usr/lib64/python3.8/site-packages/classes/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/openshot-qt", line 11, in <module>
    load_entry_point('openshot-qt==2.4.4.dev2', 'gui_scripts', 'openshot-qt')()
  File "/usr/lib64/python3.8/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.8/site-packages/pkg_resources/__init__.py", line 2853, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.8/site-packages/pkg_resources/__init__.py", line 2444, in load
    return self.resolve()
  File "/usr/lib64/python3.8/site-packages/pkg_resources/__init__.py", line 2450, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib64/python3.8/site-packages/openshot_qt/launch.py", line 52, in <module>
    from classes import info
ImportError: cannot import name 'info' from 'classes' (/usr/lib64/python3.8/site-packages/classes/__init__.py)

Sorry for the long preamble. It's installing classes-0.1.0. Anyone suggest a next move?

teckk 01-29-2020 01:44 PM

I'll give you all the info that I can get my hands on.
Code:

pacman -Si openshot
...
Name            : openshot
Version        : 2.4.4-4
Description    : An award-winning free and open-source video editor
Architecture    : any
URL            : https://www.openshot.org/
Licenses        : GPL3
...
Depends On      : ffmpeg  python-mlt  python-pyqt5  python-requests  libopenshot
                  libopenshot-audio  python-pyzmq  qt5-base  qt5-svg  qt5-webkit
Optional Deps  : faac: for exporting audio using AAC
...
Download Size  : 51.68 MiB
Installed Size  : 107.03 MiB
...

pacman -S openshot
resolving dependencies...
looking for conflicting packages...

Packages (13) jsoncpp-1.9.1-1  libebur128-1.2.4-1  libmagick6-6.9.10.84-1
              libopenshot-0.2.3-6  libopenshot-audio-0.1.8-3  libpgm-5.2.122-4
              libsodium-1.0.18-1  mlt-6.18.0-3  python-mlt-6.18.0-3
              python-pyzmq-18.1.1-1  qt5-multimedia-5.14.0-1  zeromq-4.3.2-1
              openshot-2.4.4-4

Total Download Size:    59.69 MiB
Total Installed Size:  140.93 MiB

:: Proceed with installation? [Y/n] n

Code:

asp export openshot
<get PKGBUILD> for arch....
...

#PKGBUILD
pkgname=openshot
pkgver=2.4.4
pkgrel=4
pkgdesc="An award-winning free and open-source video editor"
arch=('any')
url="https://www.openshot.org/"
license=('GPL3')
depends=('ffmpeg' 'python-mlt' 'python-pyqt5' 'python-requests' 'libopenshot'
'libopenshot-audio' 'python-pyzmq' 'qt5-base' 'qt5-svg' 'qt5-webkit')
optdepends=('faac: for exporting audio using AAC')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/OpenShot/openshot-qt/archive/v$pkgver.tar.gz"
        "${pkgname}-hicolor-icons.patch::https://github.com/OpenShot/openshot-qt/pull/2837.patch")
sha512sums=('efa71f97a83b89e691b7dab09288ba7d3e91eb25119669fa8f6e28becb8d4cb3e60a923f936ee4ff9a593d016fe3a6b0348153cff937ab7d21a5517de5dfa10c'
            '97ebbe5d289d89c5da307076d7a3a0f517f57e8fd8123a920d031585bd48e1ccdcaa9f8180e976dd602e562d0bd2373e4bf5059dc72cf04b61b462b72a8bba1f')

prepare() {
  mv -v "${pkgname}-qt-${pkgver}" "${pkgname}-${pkgver}"
  cd "${pkgname}-${pkgver}"
  # Fix hicolor icon paths
  patch -Np1 -i "../${pkgname}-hicolor-icons.patch"
}

build() {
  cd "${pkgname}-${pkgver}"
  python setup.py build
}

package() {
  cd "${pkgname}-${pkgver}"
  python setup.py install --skip-build \
                          --optimize=1 \
                          --prefix=/usr \
                          --root="${pkgdir}"
  install -vDm 644 {AUTHORS,{CONTRIBUTING,README}.md} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"

Code:

>>> import classes
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'classes

I looked at all of those python depends. I don't see classes.
Code:

curl -LI https://github.com/OpenShot/openshot-qt/archive/v2.4.4.tar.gz
HTTP/1.1 302 Found
Server: GitHub.com
Date: Wed, 29 Jan 2020 19:36:54 GMT
...
Content-Type: application/x-gzip
Content-Disposition: attachment; filename=openshot-qt-2.4.4.tar.gz
X-Geo-Block-List:
Date: Wed, 29 Jan 2020 19:36:54 GMT
X-Varnish: 312317020
Age: 0
Via: 1.1 varnish-v4
Accept-Ranges: bytes
X-GitHub-Request-Id: 9CEA:1E5C:3755D:6998C:5E31DED6

Good luck. That's about all I have short of trying to build it.

teckk 01-29-2020 02:04 PM

Here is this.
https://github.com/OpenShot/openshot.../src/launch.py
https://github.com/OpenShot/openshot...op/src/classes
https://github.com/OpenShot/openshot...lasses/info.py

captain_sensible 01-29-2020 02:33 PM

2 Attachment(s)
i'm on current last updated to kernel 5.4.12 see image to see what i get for openshot

i went for cinelerra - compare the deps

its not quite true that slackware doesn't do tracking of deps. By "diligent" use of slpkg , i've both installed what I want' kept what I want by blacklisting and still managed to upgrade from 4.9.75 to 5.4.12 using slackpkg

business_kid 01-30-2020 05:43 AM

@tekk & captain sensible: Thank you both for your replies.

@captain sensible: Python modules are a world apart from normal deps, because ldd doesn't reveal them. I'm glad you managed your kernel update, but kernels aren't really the worry. I've updated major kernel changes, and the only one I had real hassle with was kernel 2.x.x --> 3.x.x.

@tekk. I think we have different openshot versions. You seem to have 2.4.4, I have 2.4.4 in an AppImage, but ponce had these 20191111 packages up and I'm trying them. That version wants classes.

I went back to my error, specifically, this line
Code:

ImportError: cannot import name 'info' from 'classes' (/usr/lib64/python3.8/site-packages/classes/__init__.py)
. Now classes is installed in python3.8, so I grokked _init__.py. I found it wanting. This is __init__.py
Code:

bash-5.0$ cat /usr/lib64/python3.8/site-packages/classes/__init__.py
# -*- coding: utf-8 -*-

"""
Here we define the public API of our module.

Make sure to mark all imports as ``as`` imports,
so mypy's ``implicit_reexport`` rule will be happy.
"""

from classes.typeclass import typeclass as typeclass
bash-5.0$

The only thing it apparently does is load typeclass.py from the same directory. Do I read that right? Anyhow, from the links @tekk provided, it seems there's no _init__py on github. So I removed classes, and hey presto, it picked up on the openshot-qt/classes package. I don't know what else is broken, but we'll cross that bridge when we come to it. That throws a different error:
Code:

Module: _openshot

Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/openshot_qt/classes/app.py", line 73, in __init__
    from classes import settings, project_data, updates, language, ui_util, logger_libopenshot
  File "/usr/lib64/python3.8/site-packages/openshot_qt/classes/logger_libopenshot.py", line 31, in <module>
    import openshot
  File "/usr/lib64/python3.8/site-packages/openshot.py", line 15, in <module>
    import _openshot
ImportError: libzmq.so.5: cannot open shared object file: No such file or directory

IIRC, zeromq was one of the things I built back when I tried compiling openshot. It sounds like a likely place for libzmq. I won't mark this solved, but I'll go hunting

teckk 01-30-2020 08:00 AM

https://github.com/OpenShot/openshot...ee/develop/src

The original error
Code:

File "/usr/lib64/python3.8/site-packages/openshot_qt/launch.py", line 47, in <module>
    from classes import info
ImportError: cannot import name 'info' from 'classes' (/usr/lib64/python3.8/site-packages/classes/__init__.py)

From:
https://raw.githubusercontent.com/Op.../src/launch.py line 47
Code:

try:
    from classes import info

This is what it is looking for and not finding:
https://raw.githubusercontent.com/Op...lasses/info.py

This is the classes it's looking for:
https://github.com/OpenShot/openshot...op/src/classes

This is __init__.py for this python project
https://raw.githubusercontent.com/Op...rc/__init__.py

business_kid 01-30-2020 08:17 AM

In my last post I neglected to mention that I had uninstalled classes with pip3 more than once, so I upgraded openshot with itself just to be sure.

I was right - zeromq it was. Now I get this:
Code:

Traceback (most recent call last):
  File "/usr/lib64/python3.8/site-packages/openshot_qt/classes/app.py", line 73, in __init__
    from classes import settings, project_data, updates, language, ui_util, logger_libopenshot
  File "/usr/lib64/python3.8/site-packages/openshot_qt/classes/logger_libopenshot.py", line 31, in <module>
    import openshot
  File "/usr/lib64/python3.8/site-packages/openshot.py", line 15, in <module>
    import _openshot
ImportError: /usr/lib64/libQt5OpenGL.so.5: undefined symbol: _ZN7QBezier10fromPointsERK7QPointFS2_S2_S2_, version Qt_5_PRIVATE_API

I wonder how many of these will there be? Let's hope ponce has that too.

teckk 01-30-2020 08:26 AM

That PKGBUILD has all the info that you need to build it from source. You may have to modify the $paths to fit slack.

You need all of the depends installed
Code:

'ffmpeg' 'python-mlt' 'python-pyqt5' 'python-requests' 'libopenshot'
'libopenshot-audio' 'python-pyzmq' 'qt5-base' 'qt5-svg' 'qt5-webkit'

optional
Code:

'faac: for exporting audio using AAC'
You need python setup tools
Code:

makedepends=('python-setuptools')
The source
https://github.com/OpenShot/openshot.../v2.4.4.tar.gz

Patch for icons
https://github.com/OpenShot/openshot-qt/pull/2837.patch

Checksums for those files
Code:

efa71f97a83b89e691b7dab09288ba7d3e91eb25119669fa8f6e28becb8d4cb3e60a923f936ee4ff9a593d016fe3a6b0348153cff937ab7d21a5517de5dfa10c

97ebbe5d289d89c5da307076d7a3a0f517f57e8fd8123a920d031585bd48e1ccdcaa9f8180e976dd602e562d0bd2373e4bf5059dc72cf04b61b462b72a8bba1f

Apply patch
Code:

patch -Np1 -i "../${pkgname}-hicolor-icons.patch"
Build it
Code:

python setup.py build
Install it(You'll need to modify this for Slack, paths, Install it instead of making a package...)
Code:

python setup.py install --skip-build --optimize=1 --prefix=/usr --root="${pkgdir}"
 
install -vDm 644 {AUTHORS,{CONTRIBUTING,README}.md} -t "${pkgdir}/usr/share/doc/${pkgname}"


business_kid 01-30-2020 08:55 AM

I neglected to mention in my long post that as I had removed the classes module with pip3 more than once, I reinstalled openshot

As for the deps, there's more deps than that list. It needs zeromq (python3-zmq doesn't cut it afaik; I've exploded them both)


libOpengl.so.5 is in the main qt5 package. Now ponce only has qt-5.9.9, but alien has 5.13.2, which is installed. So I'll have to hunt a later one, or stay on my AppImage, which is 2.4.4. I refuse to compile things, not because I can't, but because I won't. The openshot guys use the hardest to get latest versions of everything and seem to include a couple that haven't been written yet!

So if there's a later Qt5 package, I'll use it. If there isn't, although qt5 is easy enough to compile, I'll stay on my AppImage. Thanks tekk for your help, but I'm not in the mood for suffering. I've certainly ran aground before on openshot before looking for software that wasn't up there.

business_kid 01-31-2020 04:28 AM

Final word on this: The latest qt package I can find is 5.13.2, from alien's repo. It's installed.
I also have qt-4.8.7; I have a separate thread asking if I still need this(just in case it's fouling things). My openshot appimage is dated July 2019 and is version 2.4.4. It can stay.

Indus.Lord 01-30-2021 07:19 AM

Generate dependency graph
 
Quote:

Originally Posted by captain_sensible (Post 6084216)
i'm on current last updated to kernel 5.4.12 see image to see what i get for openshot

i went for cinelerra - compare the deps

its not quite true that slackware doesn't do tracking of deps. By "diligent" use of slpkg , i've both installed what I want' kept what I want by blacklisting and still managed to upgrade from 4.9.75 to 5.4.12 using slackpkg

Hello captain_sensible,

Would you kind enough detail how you creating the dependency graph thumbnails. ? Looks a useful feature to know.

Thanks

business_kid 01-30-2021 01:10 PM

Hello, Indus, & welcome to LQ.

That was a lively thread, but it's a year old at this stage, so I wouldn't post there.

LQ rules suggest that if you have a problem, you post your own thread. It's often faster actually to search the threads on the site. Have a look at this: How_To_Ask_a_Question

Indus.Lord 01-31-2021 02:15 AM

Thank you
 
Quote:

Originally Posted by business_kid (Post 6213964)
Hello, Indus, & welcome to LQ.

That was a lively thread, but it's a year old at this stage, so I wouldn't post there.

LQ rules suggest that if you have a problem, you post your own thread. It's often faster actually to search the threads on the site. Have a look at this: How_To_Ask_a_Question

Yes I should have started a new thread.


All times are GMT -5. The time now is 06:21 PM.