Rapid Photo Downloader ready for gentoo

@damonlynch

as you know from our other thread, I’m very grateful, as 0.9.17 now easily installs in gentoo.

It’s today’s behaviour is, to insist on

  • installation per user (which might end up in multiple installations per machine)
  • install to ~/.local/bin

Gentoo (and I believe other distros as well) usually install as root (and btw is quite restrictive with sudo) and everything not in repos should be in /usr/local/bin (executable by normal users indeed)

If the installation could be modified towards this architecture, it would be further more simplified to go into gentoo :slight_smile:

Do you see any chance, in the future RPD could move in this direction?

Cheers
Axel

No. The Rapid Photo Downloader install script uses Python’s pip, which is a widely used tool in the Python world. Pip installs Python user packages according to Linux standards.

The Gentoo community needs to update the Gentoo package for Rapid Photo Downloader, which is now many years out of date. You could lead that effort if you like.

You find me confused, RPD is absolutely the only software out of hundreds of software packages that want to be installed in the user’s home directory. I do not see where gentoo has an obsolete structure. But I’m not a software pro :blush:

This is a long way of addressing your confusion:

Currently Rapid Photo Downloader can be installed two ways: from the Linux distribution’s software repository, or from the installation script I write and maintain.

In an ideal world, it would be better to install the program from the distribution’s software repository. The program would be installed into the standard location programs go. The main problem with that method is that the version is often out of date, or there can be packaging bugs. There can be bugs because Rapid Photo Downloader has a lot of dependencies, which makes it easier for things to go wrong compared to a more simple program.

So I maintain the installation script to be able to deal with complexity of the different Linux distributions. The installation script has two primary tasks: install dependencies using the distribution’s package manager, and then use pip to install a bunch of Python dependencies and the program itself.

Best practice with pip is to install as much as possible on the user’s home directory. Installing Python packages as root with pip is highly recommended against and can easily result in a system that no longer works properly.

If pip did not exist, the installation script would not exist, and users would need to wait 6 or more months to be able to access new versions.

I tried to make a snap package but due to a still outstanding bug in the snap packager, that failed.

AppImage was tried but that effort also failed due to the complexity of the dependencies.

I’ve not tried Flatpak. As far as I know, nobody has attempted to build a Flatpak for Rapid Photo Downloader.

The installation script is a compromise. It’s far from ideal. It means no visibility in the application “stores” the mainstream distributions ship with these days. It takes me time to maintain it. It’s confusing for users who don’t know how to use the command line.

Also please keep in mind that anyone who maintains a FOSS program always needs to make compromises, because we have limited time, and the Linux distribution landscape is so fractured.

I haven’t seen a flatpak of RPD either, and I’ve been looking. Its on my list of things to try, and I enquired about it in the flatpak IRC a while ago and got some advice.

The nice thing I’ve found about flatpak is that the community is helpful, so if I can pull something together, there is a strong possibility to get help with the final bits.

I think you have identified something important there, because almost always, something goes wrong and you cannot fix it yourself. The snap community is also helpful and engaged, but the point-person for the bug I encountered with snap wanted to me to fix it, and I just don’t have time these days to be contributing to other projects.

Dear @damonlynch

thank you very much for your comprehensive explanation.

Typically gentoo is quit up to date and compile everything acc to loacal machine setting locally. It should be a perfect harbour for RPD :slight_smile:

I wish I could promise to be a good ebuild maintainer, unfortunately I know, I cannot (tooooooo many other things…)

For the time being I’m happy, that also my PC after laptop installed 0.9.17 nicely…

Sincerely
Axel

@damonlynch
how is your dissertation going on?

gentoo has changed to python 3.7 as its default. I guess due to this RPD does not work anymore on my laptop (PC yet to be tested).

So I downloaded the install.py again and started with: python3.7 install(1).py

and I got:
Detected Linux distribution Gentoo 0.0
These Python3 packages will be upgraded for your user (i.e. not system-wide): pip, setuptools, wheel
Der folgende Befehl wird ausgeführt:

/usr/bin/python3.7 -m pip install --user --upgrade pip setuptools wheel --disable-pip-version-check


Collecting pip
  Downloading pip-20.1.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 2.1 MB/s 
Collecting setuptools
  Downloading setuptools-46.4.0-py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 3.8 MB/s 
Requirement already up-to-date: wheel in /usr/lib/python3.7/site-packages (0.34.2)
Installing collected packages: pip, setuptools
Successfully installed pip-20.1.1 setuptools-46.4.0
Restarting script using /usr/bin/python3.7
Downloading https://launchpad.net/rapid/pyqt/0.9.24/+download/rapid-photo-downloader-0.9.24.tar.gz (8.15 MB)
Downloading.... done!
Es wird geprüft, ob eine ältere Version mit pip installiert wurde …
This program requires:
Gdk 3.0 from gi.repositry
Please install them using your distribution's standard installation tools.

eix gdk gives me 2.4 as the latest (sorry for Geman in between; Beschreibung = description):

[I] x11-libs/gdk-pixbuf
     Verfügbare Versionen:   (2) 2.40.0
       {X gtk-doc +introspection jpeg tiff ABI_MIPS="n32 n64 o32" ABI_RISCV="lp64 lp64d" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installierte Versionen: 2.40.0(2)(04:00:02 07.03.2020)(X introspection jpeg tiff -gtk-doc ABI_MIPS="-n32 -n64 -o32" ABI_RISCV="-lp64 -lp64d" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Startseite:             https://git.gnome.org/browse/gdk-pixbuf
     Beschreibung:           Image loading library for GTK+

or is this, what is needed?

* dev-ruby/ruby-gdk3
     Verfügbare Versionen:   3.3.2^t ~3.3.6^t ~3.3.7^t {test RUBY_TARGETS="ruby24 ruby25 ruby26"}
     Startseite:             https://ruby-gnome2.osdn.jp/
     Beschreibung:           Ruby GDK-3.x bindings

starting RDP as is gives me:

Traceback (most recent call last):
  File "/home/gerber/.local/bin/rapid-photo-downloader", line 5, in <module>
    from raphodo.rapid import main
ModuleNotFoundError: No module named 'raphodo'

Is there a way to get it back to work again?

Thanks in advance!

openSUSE Tumbleweed is on python >= 3.7 for a while and our rpd package works very nicely with both python versions (3.7.x and 3.8.x). maybe someone could just do an ebuild or rpd?

It’s going well thanks but I need to finish it :wink:

You need to install the gentoo package for PyGObject (which in turn requires pycairo). I have no idea what those two packages are called on gentoo, sorry.

Rapid Photo Downloader works with Python 3.4 - 3.8.

And yes, it would be great if someone did an ebuild.

both are installed already and up2date prior my todays initial post… so I’m stuck here :no_mouth:

So you are sure you have this package installed?

https://packages.gentoo.org/packages/dev-python/pygobject

But at the same time if you run this from within python3, this fails?

import gi
gi.require_version('Gdk', '0.3')

If so, something is broken.

@AxelG
First I would like to know where to find the ebuild you use.

To the problem: As you know Gentoo allows you to install different versions of certain packages at the same time (-> slots). So the obvious question: After updating python to 3.7 did portage rebuild all python modules? If not simply run emerge -uDN @world to get a deep (=including all dependencies) update picking up USE-Flag changes.
Equally important is that after the python update you set the system python interpreter to python3.7. emerge won’t uninstall python-3.6 by itself. So first use eselect python to set the interpreter to python3.7, then emerge -C python:3.6

(What I don’t understand ATM: RPD is a PyQT5 application, so what do you need gdk for?)

Short answer: That’s a remnant from version 0.9.22 that should be removed.

Longer answer: Version 0.9.22 used Gdk to detect if any screens had scaling enabled very early in application startup. Using Qt to detect the scaling that early in the application lifetime would fail on a Gtk based desktop, because Gtk and KDE take different approaches to low level X settings. The code using Gdk was removed in 0.9.23 and replaced with code that probes xsettings instead. Detecting scaling very early in application start up is needed because simply enabling HighDPI scaling when it was not needed (i.e. system scaling is 1.0) resulted in severe window rendering corruption on some Gtk desktops.

Yes! 2.28.6-r55 and 3.34.0

[I] dev-python/pygobject
     Verfügbare Versionen:   
     (2)    2.28.6-r55^t
     (3)    3.32.1^t 3.34.0^t
       {+cairo examples libffi test PYTHON_TARGETS="python2_7 python3_6 python3_7 python3_8"}
     Installierte Versionen: 2.28.6-r55(2)^t(09:46:08 01.05.2020)(-examples -libffi -test PYTHON_TARGETS="python2_7") 3.34.0(3)^t(21:45:45 07.05.2020)(cairo -examples -test PYTHON_TARGETS="python2_7 python3_7 -python3_6 -python3_8")
     Startseite:             https://pygobject.readthedocs.io/
     Beschreibung:           Python bindings for GObject Introspection

unfortunately yes:

$ python3 import gi
/usr/lib/python-exec/python3.7/python3: can't open file 'import': [Errno 2] No such file or directory

If I would know, what :slight_smile: indeed I will do an “equery check…” and also I will look after above file.

…done…all relevant software installations are healthy:
# equery check dev-lang/python
* Checking dev-lang/python-2.7.18 …
4580 out of 4580 files passed

* Checking dev-lang/python-3.6.10-r2 ...
   7045 out of 7045 files passed

* Checking dev-lang/python-3.7.7-r2 ...
   7278 out of 7278 files passed

* Checking dev-lang/python-3.8.2-r2 ...
   7494 out of 7494 files passed

.

equery check pycairo
* Checking dev-python/pycairo-1.18.2 ...
   49 out of 49 files passed

.

equery check pygobject
* Checking dev-python/pygobject-2.28.6-r55 ...
   196 out of 196 files passed

* Checking dev-python/pygobject-3.34.0 ...
   231 out of 231 files passed

.

As you could see from this thread above, there is no ebuild, I use the install.py from the homepage

that is indeed in my /etc/cron.weekly (together with an eix-sync)

It would be embarrasing if I wouldn’t :slight_smile:

$ eselect python list
Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7
  [4]   python3.8 (fallback)

Hmmm as we see from above, python 3.6 is still there, I knew that, just have difficulties to believe, this would make any difference. Lensfun still need 3.6 hence I won’t uninstall 3.6 atm…

Sorry, I meant you had to run the Python interpreter from within a terminal window and run those two commands within the interpreter, not from the shell. In any case, it’s somewhat irrelevant because you don’t need gdk in Rapid Photo Downloader >= 0.9.23. I have updated the install.py script to reflect this.

Delete the current install.py script and download and use this one (enter the command on one line):

wget https://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/download/damonlynch%40gmail.com-20200522162207-hfjuwz45tn9qw207/install.sh-20160314191008-iy73j6kjbhwpk0t9-1/install.py

@damonlynch
first of all thank you very much.

I did so and installed afterwards.

Running it caused me the following:

Traceback (most recent call last):
  File "./rapid-photo-downloader", line 5, in <module>
    from raphodo.rapid import main
  File "/home/gerber/.local/lib/python3.7/site-packages/raphodo/rapid.py", line 125, in <module>
    from raphodo.thumbnaildisplay import (
  File "/home/gerber/.local/lib/python3.7/site-packages/raphodo/thumbnaildisplay.py", line 72, in <module>
    from raphodo.rpdsql import ThumbnailRowsSQL, ThumbnailRow
  File "/home/gerber/.local/lib/python3.7/site-packages/raphodo/rpdsql.py", line 32, in <module>
    from tenacity import retry, stop_after_attempt
  File "/usr/lib/python3.7/site-packages/tenacity/__init__.py", line 352
    from tenacity.async import AsyncRetrying
                      ^
SyntaxError: invalid syntax

Should I have uninstalled something manually?

That indicates a problem in the python package tenacity in your system. I don’t know the steps that led to this problem, because I don’t use gentoo. That’s something you’ll need to figure out in order to get any program working that uses tenacity.

I checked with equery check tenacity. Seems clean … :thinking:

which version is minimum required?

@damonlynch
together we made it. THANK YOU SOOO MUCH

upgraded to tenacity-6.1.0 and that further pulled dev-python/futures-3.1.1 and virtual/python-futures-1

now it works

1 Like