Latest version install script errors on installation...

I am getting the followig error when installing the latest RFD via provided install.py.

System:    Host: maxg-pc-mint Kernel: 5.4.0-90-generic x86_64 bits: 64 Desktop: Cinnamon 5.0.7 Distro: Linux Mint 20.2 Uma 
Machine:   Type: Desktop Mobo: ASUSTeK model: P7H55-M LX v: X.0x serial: <superuser/root required> BIOS: American Megatrends 
           v: 0303 date: 07/15/2010 
CPU:       Topology: Dual Core model: Intel Core i5 650 bits: 64 type: MT MCP L2 cache: 4096 KiB 
           Speed: 1282 MHz min/max: 1200/3201 MHz Core speeds (MHz): 1: 1301 2: 1250 3: 1296 4: 1218 

Python:    3.8.10
python3 install2021.py
Detected Linux distribution Linux Mint 20.2 
Traceback (most recent call last):
  File "install2021.py", line 14594, in <module>
    main()
  File "install2021.py", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "install2021.py", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

I have no idea what to do with this… :frowning:

1 Like

To analyze your problem I made a fresh install of Linux Mint 20.2 in VirtualBox, and updated it. I then ran the install script and it all worked as expected. Have you ensured all your software sources are working as expected, and you have kept the system up to date?

1 Like

I had a look at the terminal, and the following was shown:

python3 "install (1).py"
Detected Linux distribution Linux Mint 20.2 

pip will be upgraded from version 21.2.4 to version 21.3.1
setuptools will be upgraded from version 51.1.0.post20201221 to version 60.1.0
wheel 0.34.2 is up to date
These Python3 packages will be upgraded for your user (i.e. not system-wide): pip, setuptools
The following command will be run:

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


Requirement already satisfied: pip in /home/maxg/.local/lib/python3.8/site-packages (21.2.4)
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Requirement already satisfied: setuptools in /home/maxg/.local/lib/python3.8/site-packages (51.1.0.post20201221)
Collecting setuptools
  Downloading setuptools-60.1.0-py3-none-any.whl (952 kB)
     |████████████████████████████████| 952 kB 1.4 MB/s 
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 51.1.0.post20201221
    Uninstalling setuptools-51.1.0.post20201221:
      Successfully uninstalled setuptools-51.1.0.post20201221
  Attempting uninstall: pip
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
launchpadlib 1.10.13 requires testresources, which is not installed.
Successfully installed pip-21.3.1 setuptools-60.1.0
Restarting script using /usr/bin/python3
Traceback (most recent call last):
  File "install (1).py", line 14594, in <module>
    main()
  File "install (1).py", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "install (1).py", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

I thought it did not like the space in the install (1).py name, and renamed it to install2021.py, which resulted in what I initially posted.
… which seems to be the same, except for some precursory error regarding ‘testresources’.

After reading your response, I did the following:

# [2021-12-28 05:33] maxg@maxg-pc-mint ~/Downloads $ 
pip install -U testresources
Defaulting to user installation because normal site-packages is not writeable
Collecting testresources
  Downloading testresources-2.0.1-py2.py3-none-any.whl (36 kB)
Collecting pbr>=1.8
  Downloading pbr-5.8.0-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 2.0 MB/s            
Installing collected packages: pbr, testresources
Successfully installed pbr-5.8.0 testresources-2.0.1

# [2021-12-28 05:33] maxg@maxg-pc-mint ~/Downloads $ 
python3 install2021.py
Detected Linux distribution Linux Mint 20.2 
Traceback (most recent call last):
  File "install2021.py", line 14594, in <module>
    main()
  File "install2021.py", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "install2021.py", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py
# [2021-12-28 05:34] maxg@maxg-pc-mint ~/Downloads $ 
sudo pip install -U testresources
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
  warnings.warn(
Collecting testresources
  Downloading testresources-2.0.1-py2.py3-none-any.whl (36 kB)
Collecting pbr>=1.8
  Downloading pbr-5.8.0-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 549 kB/s 
Installing collected packages: pbr, testresources
Successfully installed pbr-5.8.0 testresources-2.0.1
# [2021-12-28 05:34] maxg@maxg-pc-mint ~/Downloads $ 
python3 install2021.py
Detected Linux distribution Linux Mint 20.2 
Traceback (most recent call last):
  File "install2021.py", line 14594, in <module>
    main()
  File "install2021.py", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "install2021.py", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

It looks like I have two python3 environments?! Not sure why that is.

I use the built-in software updater in Linux Mint to keep the system up-to-date.

I am on RFD version 0.9.26 … since it works, I may well stick with it, as I am not educated enough to look into the encountered errors.

[update1]
I run the help modules command in python3 and get this:

python3
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> modules
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'modules' is not defined
>>> help("modules")

Please wait a moment while I gather a list of all available modules...

/home/maxg/.local/lib/python3.8/site-packages/IPython/kernel/__init__.py:12: ShimWarning: The `IPython.kernel` package has been deprecated since IPython 4.0.You should import from ipykernel or jupyter_client instead.
  warn("The `IPython.kernel` package has been deprecated since IPython 4.0."
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:36: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
INFO:root:Generating grammar tables from /usr/lib/python3.8/lib2to3/Grammar.txt
INFO:root:Generating grammar tables from /usr/lib/python3.8/lib2to3/PatternGrammar.txt
/usr/lib/python3.8/pkgutil.py:92: MatplotlibDeprecationWarning: 
The mpl_toolkits.axes_grid module was deprecated in Matplotlib 2.1 and will be removed two minor releases later. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist, which provide the same functionality instead.
  __import__(info.name)
DEBUG:oneconf.distributor:get_distro: 'Linuxmint'
WARNING:oneconf.distributor:invalid distro: 'Linuxmint'
/usr/lib/python3.8/pkgutil.py:107: VisibleDeprecationWarning: zmq.eventloop.minitornado is deprecated in pyzmq 14.0 and will be removed.
    Install tornado itself to use zmq with the tornado IOLoop.

One error refers to _distutils_hack/__init__.py
The other to DEBUG:oneconf.distributor:get_distro: 'Linuxmint' WARNING:oneconf.distributor:invalid distro: 'Linuxmint'

My limited knowledge sees a link to the error message from install.py, but I do not know how to fix these (if these need fixing at all).
[/update1]

You have pbr installed. That is one of Python’s various package management systems (unfortunately there are several). I am not sure but I guess pbr is not so popular these days, but that’s irrelevant to the problem at hand. If you need it for something then you need it. My guess is that it (or something else) is causing a conflict with other Python packages.

To fix the problem, essentially you need to isolate Python programs that run using packages in your user space, like Rapid Photo Downloader installed using the install script does. The way to do that is using virtual environments. You should consider using a virtual environment with all your other Python programs that similarly run in user space too, because they are clearly causing conflicts. Fortunately the install script handles installing Rapid Photo Downloader in a virtual environment. See Rapid Photo Downloader: Documentation

For your other Python programs, you need to take care of them yourself.

1 Like

@Max_G did you solve the problem?

I am having the same issue with the installation script. I tried following the process to install the program in a virtual environment, but the script still failed:

Do you want to install Rapid Photo Downloader into the current virtual environment?  [Y/n] y
Using virtual environment for installation using pip.
Detected Linux distribution Linux Mint 20.2 
To run this program, programs to assist Python 3 and its package management must be installed.

The following command will be run:

/home/amir/bin/rapid-photo-downloader/myenv/bin/python3 -m pip install  wheel --disable-pip-version-check


Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
Restarting script using /home/amir/bin/rapid-photo-downloader/myenv/bin/python3
Using virtual environment for installation using pip.

These Python3 packages will be upgraded for your user (i.e. not system-wide): pip, setuptools, wheel
The following command will be run:

/home/amir/bin/rapid-photo-downloader/myenv/bin/python3 -m pip install  --upgrade pip setuptools wheel --disable-pip-version-check


Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting setuptools
  Using cached setuptools-60.2.0-py3-none-any.whl (953 kB)
Requirement already up-to-date: wheel in ./myenv/lib/python3.8/site-packages (0.37.1)
Installing collected packages: pip, setuptools
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
  Attempting uninstall: setuptools
    Found existing installation: setuptools 44.0.0
    Uninstalling setuptools-44.0.0:
      Successfully uninstalled setuptools-44.0.0
Successfully installed pip-21.3.1 setuptools-60.2.0
Restarting script using /home/amir/bin/rapid-photo-downloader/myenv/bin/python3
Using virtual environment for installation using pip.
Traceback (most recent call last):
  File "install.py", line 14594, in <module>
    main()
  File "install.py", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "install.py", line 665, in pip_packages_required
    import setuptools
  File "/home/amir/bin/rapid-photo-downloader/myenv/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/amir/bin/rapid-photo-downloader/myenv/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/amir/bin/rapid-photo-downloader/myenv/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/home/amir/bin/rapid-photo-downloader/myenv/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

Is python3-distutils installed?

It is installed.

Do you use pip to install Python programs yourself? Or do you never use it?

I may have used it for something, but I can’t recall, I’m afraid. Is there a way to check that?

python3 -m pip list -v

If anything in the output lists pip as the installer in the right hand column, and it’s not pip, setuptools, or wheel, then the answer is yes.

It seems that there are several other packages that were installed with pip, although I don’t think I installed them manually. They must have been installed with pip via some other program’s requirements.

Can you be more specific? I’d really like to solve this problem, but it’s very difficult when I cannot replicate it myself on the exact same distribution.

Of course, sorry. Here’s the output of python3 -m pip list -v | grep pip:

arrow                  0.17.0               /home/amir/.local/lib/python3.8/site-packages pip
Babel                  2.9.0                /home/amir/.local/lib/python3.8/site-packages pip
cffi                   1.14.0               /home/amir/.local/lib/python3.8/site-packages pip
colorlog               4.6.2                /home/amir/.local/lib/python3.8/site-packages pip
colour                 0.1.5                /home/amir/.local/lib/python3.8/site-packages pip
easygui                0.97.4               /home/amir/.local/lib/python3.8/site-packages pip
gphoto2                2.2.2                /home/amir/.local/lib/python3.8/site-packages pip
Pillow                 8.0.1                /home/amir/.local/lib/python3.8/site-packages pip
pip                    21.3.1               /home/amir/.local/lib/python3.8/site-packages pip
psutil                 5.8.0                /home/amir/.local/lib/python3.8/site-packages pip
pycparser              2.20                 /home/amir/.local/lib/python3.8/site-packages pip
pyheif                 0.5.0                /home/amir/.local/lib/python3.8/site-packages pip
pymediainfo            4.2.1                /home/amir/.local/lib/python3.8/site-packages pip
PyPrind                2.11.2               /home/amir/.local/lib/python3.8/site-packages pip
PyQt5                  5.15.0               /home/amir/.local/lib/python3.8/site-packages pip
PyQt5-sip              12.8.0               /home/amir/.local/lib/python3.8/site-packages pip
python-dateutil        2.8.1                /home/amir/.local/lib/python3.8/site-packages pip
python-pidfile         3.0.0                /home/amir/.local/lib/python3.8/site-packages pip
pyxdg                  0.27                 /home/amir/.local/lib/python3.8/site-packages pip
pyzmq                  20.0.0               /home/amir/.local/lib/python3.8/site-packages pip
rapid-photo-downloader 0.9.26               /home/amir/.local/lib/python3.8/site-packages pip
rawkit                 0.6.0                /home/amir/.local/lib/python3.8/site-packages pip
requests               2.25.1               /home/amir/.local/lib/python3.8/site-packages pip
setuptools             60.1.0               /home/amir/.local/lib/python3.8/site-packages pip
sip                    4.19.21              /usr/lib/python3/dist-packages                pip
sortedcontainers       2.3.0                /home/amir/.local/lib/python3.8/site-packages pip
tenacity               6.2.0                /home/amir/.local/lib/python3.8/site-packages pip
tornado                6.1                  /home/amir/.local/lib/python3.8/site-packages pip
websocket-client       1.0.1                /home/amir/.local/lib/python3.8/site-packages pip
wheel                  0.37.1               /home/amir/.local/lib/python3.8/site-packages pip

Thank you. I’ll install 0.9.26 first, and then try the upgrade to 0.9.28. Hope to do that soon.

It’s looking like a bug in setuptools. Can you try this:

python3 -m pip uninstall pip setuptools wheel
sudo apt install python3-pip python3-setuptools python3-wheel 

That should work without issue. The 2nd command may not be necessary but it won’t hurt to run it. Then run the install.py script.

Since you are on Linux Mint 20.2, these distro packaged tools are up-to-date enough to work find with PyPi. Some time ago I modified the install script to only install pip, setuptools and wheel from PyPi only when they’re too old, rather than automatically installing the latest versions.

@Max_G this might also work for you too.

That did it! Version 0.9.28 is now installed. No need for a virtual environment, either.

Thank you very much for your help. :slight_smile:

Glad to see! I’ll modify the install.py script to account for this situation. I want to bring back the PPA for Ubuntu derived systems, but it’s a massive investment in developer time. Packaging is really complex.

Well, what a coincidence… I did not see the updates to this thread.
I continued using the version I had.
A few days ago I updated Linux Mint 20.2 to 20.3 (Una), and since then RPD does not launch at all.

# [2022-01-21 17:34] maxg@maxg-pc-mint ~/Downloads $ 
python3 install.py
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:36: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Detected Linux distribution Linux Mint 20.3

setuptools will be upgraded from version 60.1.0 to version 60.5.0
These Python3 packages will be upgraded for your user (i.e. not system-wide): setuptools, wheel
The following command will be run:

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


Requirement already satisfied: setuptools in /home/maxg/.local/lib/python3.8/site-packages (60.1.0)
Collecting setuptools
  Downloading setuptools-60.5.0-py3-none-any.whl (958 kB)
     |████████████████████████████████| 958 kB 1.5 MB/s            
Requirement already satisfied: wheel in /usr/lib/python3/dist-packages (0.34.2)
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel, setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 60.1.0
    Uninstalling setuptools-60.1.0:
      Successfully uninstalled setuptools-60.1.0
Successfully installed setuptools-60.5.0 wheel-0.37.1
Restarting script using /usr/bin/python3
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Downloading https://launchpad.net/rapid/pyqt/0.9.28/+download/rapid-photo-downloader-0.9.28.tar.gz (8.44 MB)
0% [##############################] 100% | ETA: 00:00:00
Total time elapsed: 00:00:12
Loading new installer script version 0.3.15
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Traceback (most recent call last):
  File "/tmp/tmp1zbuu696/Qhu0LIArpZ", line 14605, in <module>
    main()
  File "/tmp/tmp1zbuu696/Qhu0LIArpZ", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "/tmp/tmp1zbuu696/Qhu0LIArpZ", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 71, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

ran uninstall…

# [2022-01-21 17:34] maxg@maxg-pc-mint ~/Downloads $ 
python3 install.py --uninstall-including-pip-dependencies
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:1489: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if pip_version >= StrictVersion('9.0.0'):
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: rapid-photo-downloader 0.9.26
Uninstalling rapid-photo-downloader-0.9.26:
  Successfully uninstalled rapid-photo-downloader-0.9.26
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
install.py:435: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  LooseVersion(platform.python_version()) >= LooseVersion('3.5.0')
install.py:1535: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if version and StrictVersion(version) < StrictVersion('5.11'):
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: gphoto2 2.2.2
Uninstalling gphoto2-2.2.2:
  Successfully uninstalled gphoto2-2.2.2
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: rawkit 0.6.0
Uninstalling rawkit-0.6.0:
  Successfully uninstalled rawkit-0.6.0
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: PyPrind 2.11.2
Uninstalling PyPrind-2.11.2:
  Successfully uninstalled PyPrind-2.11.2
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: easygui 0.97.4
Uninstalling easygui-0.97.4:
  Successfully uninstalled easygui-0.97.4
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: colour 0.1.5
Uninstalling colour-0.1.5:
  Successfully uninstalled colour-0.1.5
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: pymediainfo 4.2.1
Uninstalling pymediainfo-4.2.1:
  Successfully uninstalled pymediainfo-4.2.1
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: pyheif 0.5.1
Uninstalling pyheif-0.5.1:
  Successfully uninstalled pyheif-0.5.1
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: PyQt5 5.15.0
Uninstalling PyQt5-5.15.0:
  Successfully uninstalled PyQt5-5.15.0
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored

The tried to install again

# [2022-01-24 12:28] maxg@maxg-pc-mint ~/Downloads $ 
python3 install.py
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Detected Linux distribution Linux Mint 20.3
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Downloading https://launchpad.net/rapid/pyqt/0.9.28/+download/rapid-photo-downloader-0.9.28.tar.gz (8.44 MB)
Downloading.... done!
Loading new installer script version 0.3.15
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Traceback (most recent call last):
  File "/tmp/tmphco0uoqy/HNvw3pfed8", line 14605, in <module>
    main()
  File "/tmp/tmphco0uoqy/HNvw3pfed8", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "/tmp/tmphco0uoqy/HNvw3pfed8", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 71, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py
# [2022-01-24 12:29] maxg@maxg-pc-mint ~/Downloads $ 
python3 -m venv VirtualPythonEnvironment
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored

Then ran the pip list

# [2022-01-24 12:33] maxg@maxg-pc-mint ~/Downloads $ 
python3 -m pip list -v
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Package                  Version              Location                                      Installer
------------------------ -------------------- --------------------------------------------- ---------
ansible                  2.9.10               /home/maxg/.local/lib/python3.8/site-packages pip
apt-clone                0.2.1                /usr/lib/python3/dist-packages
apt-xapian-index         0.49                 /usr/lib/python3/dist-packages
apturl                   0.5.2                /usr/lib/python3/dist-packages
argon2-cffi              20.1.0               /home/maxg/.local/lib/python3.8/site-packages pip
arrow                    0.15.5               /usr/lib/python3/dist-packages
async-generator          1.10                 /home/maxg/.local/lib/python3.8/site-packages pip
attrs                    19.3.0               /usr/lib/python3/dist-packages
Babel                    2.6.0                /usr/lib/python3/dist-packages
backcall                 0.2.0                /home/maxg/.local/lib/python3.8/site-packages pip
bcrypt                   3.1.7                /usr/lib/python3/dist-packages
beautifulsoup4           4.8.2                /usr/lib/python3/dist-packages
bleach                   3.2.1                /home/maxg/.local/lib/python3.8/site-packages pip
blinker                  1.4                  /usr/lib/python3/dist-packages
Brlapi                   0.7.0                /usr/lib/python3/dist-packages
bs4                      0.0.1                /home/maxg/.local/lib/python3.8/site-packages pip
cached-property          1.5.1                /usr/lib/python3/dist-packages
cairocffi                1.2.0                /home/maxg/.local/lib/python3.8/site-packages pip
CairoSVG                 2.5.0                /home/maxg/.local/lib/python3.8/site-packages pip
certifi                  2019.11.28           /usr/lib/python3/dist-packages
cffi                     1.14.0               /home/maxg/.local/lib/python3.8/site-packages pip
chardet                  3.0.4                /usr/lib/python3/dist-packages
Click                    7.0                  /usr/lib/python3/dist-packages
colorama                 0.4.3                /usr/lib/python3/dist-packages
colorlog                 4.1.0                /usr/lib/python3/dist-packages
command-not-found        0.3                  /usr/lib/python3/dist-packages
configobj                5.0.6                /usr/lib/python3/dist-packages
crudini                  0.9.3                /usr/lib/python3/dist-packages
cryptography             2.8                  /usr/lib/python3/dist-packages
cssselect2               0.4.1                /home/maxg/.local/lib/python3.8/site-packages pip
cupshelpers              1.0                  /usr/lib/python3/dist-packages
cycler                   0.10.0               /usr/lib/python3/dist-packages
dbus-python              1.2.16               /usr/lib/python3/dist-packages
decorator                4.4.2                /home/maxg/.local/lib/python3.8/site-packages pip
defer                    1.0.6                /usr/lib/python3/dist-packages
defusedxml               0.6.0                /home/maxg/.local/lib/python3.8/site-packages pip
dirspec                  13.10                /usr/lib/python3/dist-packages
distro                   1.4.0                /usr/lib/python3/dist-packages
dnspython                1.16.0               /usr/lib/python3/dist-packages
docker                   4.1.0                /usr/lib/python3/dist-packages
docker-compose           1.25.0               /usr/lib/python3/dist-packages
dockerpty                0.4.1                /usr/lib/python3/dist-packages
docopt                   0.6.2                /usr/lib/python3/dist-packages
duplicity                0.8.12.0             /usr/lib/python3/dist-packages
easygui                  0.98.1               /usr/lib/python3/dist-packages
entrypoints              0.3                  /usr/lib/python3/dist-packages
fasteners                0.14.1               /usr/lib/python3/dist-packages
future                   0.18.2               /usr/lib/python3/dist-packages
gps                      3.20                 /usr/lib/python3/dist-packages
grpcio                   1.16.1               /usr/lib/python3/dist-packages
html5lib                 1.0.1                /usr/lib/python3/dist-packages
httplib2                 0.14.0               /usr/lib/python3/dist-packages
idna                     2.8                  /usr/lib/python3/dist-packages
ifaddr                   0.1.6                /usr/lib/python3/dist-packages
IMDbPY                   6.8                  /usr/lib/python3/dist-packages
importlib-metadata       1.5.0                /usr/lib/python3/dist-packages
iniparse                 0.4                  /usr/lib/python3/dist-packages
iotop                    0.6                  /usr/lib/python3/dist-packages
ipykernel                5.3.4                /home/maxg/.local/lib/python3.8/site-packages pip
ipython                  7.19.0               /home/maxg/.local/lib/python3.8/site-packages pip
ipython-genutils         0.2.0                /home/maxg/.local/lib/python3.8/site-packages pip
jedi                     0.17.2               /home/maxg/.local/lib/python3.8/site-packages pip
Jinja2                   2.11.2               /home/maxg/.local/lib/python3.8/site-packages pip
jsonschema               3.2.0                /usr/lib/python3/dist-packages
jupyter-client           6.1.7                /home/maxg/.local/lib/python3.8/site-packages pip
jupyter-core             4.6.3                /home/maxg/.local/lib/python3.8/site-packages pip
jupyterlab-pygments      0.1.2                /home/maxg/.local/lib/python3.8/site-packages pip
kazam                    1.4.5                /usr/lib/python3/dist-packages
keyring                  18.0.1               /usr/lib/python3/dist-packages
kiwisolver               1.0.1                /usr/lib/python3/dist-packages
launchpadlib             1.10.13              /usr/lib/python3/dist-packages
lazr.restfulclient       0.14.2               /usr/lib/python3/dist-packages
lazr.uri                 1.0.3                /usr/lib/python3/dist-packages
lockfile                 0.12.2               /usr/lib/python3/dist-packages
louis                    3.12.0               /usr/lib/python3/dist-packages
lxml                     4.5.0                /usr/lib/python3/dist-packages
macaroonbakery           1.3.1                /usr/lib/python3/dist-packages
Mako                     1.1.0                /usr/lib/python3/dist-packages
Markdown                 3.1.1                /usr/lib/python3/dist-packages
MarkupSafe               1.1.0                /usr/lib/python3/dist-packages
matplotlib               3.1.2                /usr/lib/python3/dist-packages
meld                     3.20.2               /usr/lib/python3/dist-packages
mistune                  0.8.4                /home/maxg/.local/lib/python3.8/site-packages pip
monotonic                1.5                  /usr/lib/python3/dist-packages
more-itertools           4.2.0                /usr/lib/python3/dist-packages
nbclient                 0.5.1                /home/maxg/.local/lib/python3.8/site-packages pip
nbconvert                6.0.7                /home/maxg/.local/lib/python3.8/site-packages pip
nbformat                 5.0.8                /home/maxg/.local/lib/python3.8/site-packages pip
nemo-emblems             5.2.0                /usr/lib/python3.8/dist-packages
nest-asyncio             1.4.3                /home/maxg/.local/lib/python3.8/site-packages pip
netaddr                  0.7.19               /usr/lib/python3/dist-packages
netifaces                0.10.4               /usr/lib/python3/dist-packages
nose                     1.3.7                /usr/lib/python3/dist-packages
notebook                 6.1.5                /home/maxg/.local/lib/python3.8/site-packages pip
numpy                    1.17.4               /usr/lib/python3/dist-packages
oauthlib                 3.1.0                /usr/lib/python3/dist-packages
oneconf                  0.3.9                /usr/lib/python3/dist-packages
packaging                20.3                 /usr/lib/python3/dist-packages
PAM                      0.4.2                /usr/lib/python3/dist-packages
pandas                   1.1.4                /home/maxg/.local/lib/python3.8/site-packages pip
pandocfilters            1.4.3                /home/maxg/.local/lib/python3.8/site-packages pip
paramiko                 2.6.0                /usr/lib/python3/dist-packages
parso                    0.7.1                /home/maxg/.local/lib/python3.8/site-packages pip
pbr                      5.8.0                /home/maxg/.local/lib/python3.8/site-packages pip
pexpect                  4.6.0                /usr/lib/python3/dist-packages
pickleshare              0.7.5                /home/maxg/.local/lib/python3.8/site-packages pip
Pillow                   7.0.0                /usr/lib/python3/dist-packages
pip                      21.3.1               /home/maxg/.local/lib/python3.8/site-packages pip
piston-mini-client       0.7.5                /usr/lib/python3/dist-packages
Pivy                     0.6.5                /usr/lib/python3/dist-packages
prometheus-client        0.8.0                /home/maxg/.local/lib/python3.8/site-packages pip
prompt-toolkit           3.0.8                /home/maxg/.local/lib/python3.8/site-packages pip
protobuf                 3.6.1                /usr/lib/python3/dist-packages
psutil                   5.5.1                /usr/lib/python3/dist-packages
ptyprocess               0.6.0                /home/maxg/.local/lib/python3.8/site-packages pip
pyasn1                   0.4.2                /usr/lib/python3/dist-packages
pycairo                  1.16.2               /usr/lib/python3/dist-packages
pycparser                2.20                 /home/maxg/.local/lib/python3.8/site-packages pip
pycrypto                 2.6.1                /usr/lib/python3/dist-packages
pycups                   1.9.73               /usr/lib/python3/dist-packages
pycurl                   7.43.0.2             /usr/lib/python3/dist-packages
Pygments                 2.7.2                /home/maxg/.local/lib/python3.8/site-packages pip
PyGObject                3.36.0               /usr/lib/python3/dist-packages
PyICU                    2.4.2                /usr/lib/python3/dist-packages
pyinotify                0.9.6                /usr/lib/python3/dist-packages
PyJWT                    1.7.1                /usr/lib/python3/dist-packages
pymacaroons              0.13.0               /usr/lib/python3/dist-packages
PyMySQL                  1.0.2                /home/maxg/.local/lib/python3.8/site-packages pip
PyNaCl                   1.3.0                /usr/lib/python3/dist-packages
pyparsing                2.4.6                /usr/lib/python3/dist-packages
pyparted                 3.11.2               /usr/lib/python3/dist-packages
Pyphen                   0.10.0               /home/maxg/.local/lib/python3.8/site-packages pip
PyQt5                    5.14.1               /usr/lib/python3/dist-packages                pip
PyQt5-sip                12.8.0               /home/maxg/.local/lib/python3.8/site-packages pip
pyRFC3339                1.1                  /usr/lib/python3/dist-packages
pyrsistent               0.15.5               /usr/lib/python3/dist-packages
pyserial                 3.4                  /usr/lib/python3/dist-packages
python-apt               2.0.0+ubuntu0.20.4.6 /usr/lib/python3/dist-packages
python-dateutil          2.7.3                /usr/lib/python3/dist-packages
python-debian            0.1.36ubuntu1        /usr/lib/python3/dist-packages
python-magic             0.4.16               /usr/lib/python3/dist-packages
python-xapp              2.2.1                /usr/lib/python3/dist-packages
python-xlib              0.23                 /usr/lib/python3/dist-packages
pytz                     2019.3               /usr/lib/python3/dist-packages
pyxattr                  0.6.1                /usr/lib/python3/dist-packages
pyxdg                    0.26                 /usr/lib/python3/dist-packages
PyYAML                   5.3.1                /usr/lib/python3/dist-packages
pyzmq                    18.1.1               /usr/lib/python3/dist-packages
reportlab                3.5.34               /usr/lib/python3/dist-packages
requests                 2.22.0               /usr/lib/python3/dist-packages
requests-file            1.4.3                /usr/lib/python3/dist-packages
requests-unixsocket      0.2.0                /usr/lib/python3/dist-packages
SecretStorage            2.3.1                /usr/lib/python3/dist-packages
Send2Trash               1.5.0                /home/maxg/.local/lib/python3.8/site-packages pip
sessioninstaller         0.0.0                /usr/lib/python3/dist-packages
setproctitle             1.1.10               /usr/lib/python3/dist-packages
setuptools               60.5.0               /home/maxg/.local/lib/python3.8/site-packages pip
simplejson               3.16.0               /usr/lib/python3/dist-packages
sip                      4.19.21              /usr/lib/python3/dist-packages                pip
six                      1.14.0               /usr/lib/python3/dist-packages
sortedcontainers         2.1.0                /usr/lib/python3/dist-packages
soupsieve                1.9.5                /usr/lib/python3/dist-packages
system-service           0.3                  /usr/lib/python3/dist-packages
tenacity                 6.2.0                /home/maxg/.local/lib/python3.8/site-packages pip
terminado                0.9.1                /home/maxg/.local/lib/python3.8/site-packages pip
testpath                 0.4.4                /home/maxg/.local/lib/python3.8/site-packages pip
testresources            2.0.1                /home/maxg/.local/lib/python3.8/site-packages pip
texttable                1.6.2                /usr/lib/python3/dist-packages
thin-client-config-agent 0.8                  /usr/lib/python3/dist-packages
tinycss2                 1.0.2                /usr/lib/python3/dist-packages
tldextract               2.2.1                /usr/lib/python3/dist-packages
tornado                  5.1.1                /usr/lib/python3/dist-packages
traitlets                5.0.5                /home/maxg/.local/lib/python3.8/site-packages pip
ubuntu-advantage-tools   27.5                 /usr/lib/python3/dist-packages
ubuntu-drivers-common    0.0.0                /usr/lib/python3/dist-packages
ufw                      0.36                 /usr/lib/python3/dist-packages
Unidecode                1.1.1                /usr/lib/python3/dist-packages
urllib3                  1.25.8               /usr/lib/python3/dist-packages
virtkey                  0.63.0               /usr/lib/python3/dist-packages
wadllib                  1.3.3                /usr/lib/python3/dist-packages
wcwidth                  0.2.5                /home/maxg/.local/lib/python3.8/site-packages pip
WeasyPrint               52.2                 /home/maxg/.local/lib/python3.8/site-packages pip
webencodings             0.5.1                /usr/lib/python3/dist-packages
websocket-client         0.53.0               /usr/lib/python3/dist-packages
wheel                    0.37.1               /home/maxg/.local/lib/python3.8/site-packages pip
wxPython                 4.0.7                /usr/lib/python3/dist-packages
xkit                     0.0.0                /usr/lib/python3/dist-packages
xlrd                     1.1.0                /usr/lib/python3/dist-packages
youtube-dl               2021.4.26            /usr/lib/python3/dist-packages
zipp                     1.0.0                /usr/lib/python3/dist-packages

Then ran the two commands as indicated:

# [2022-01-24 12:35] maxg@maxg-pc-mint ~/Downloads $ 
python3 -m pip uninstall pip setuptools wheel
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Found existing installation: pip 21.3.1
Uninstalling pip-21.3.1:
  Would remove:
    /home/maxg/.local/bin/pip
    /home/maxg/.local/bin/pip3
    /home/maxg/.local/bin/pip3.8
    /home/maxg/.local/lib/python3.8/site-packages/pip-21.3.1.dist-info/*
    /home/maxg/.local/lib/python3.8/site-packages/pip/*
Proceed (Y/n)? 
  Successfully uninstalled pip-21.3.1
Found existing installation: setuptools 60.5.0
Uninstalling setuptools-60.5.0:
  Would remove:
    /home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/*
    /home/maxg/.local/lib/python3.8/site-packages/distutils-precedence.pth
    /home/maxg/.local/lib/python3.8/site-packages/pkg_resources/*
    /home/maxg/.local/lib/python3.8/site-packages/setuptools-60.5.0.dist-info/*
    /home/maxg/.local/lib/python3.8/site-packages/setuptools/*
Proceed (Y/n)? y
  Successfully uninstalled setuptools-60.5.0
Found existing installation: wheel 0.37.1
Uninstalling wheel-0.37.1:
  Would remove:
    /home/maxg/.local/bin/wheel
    /home/maxg/.local/lib/python3.8/site-packages/wheel-0.37.1.dist-info/*
    /home/maxg/.local/lib/python3.8/site-packages/wheel/*
Proceed (Y/n)? y
  Successfully uninstalled wheel-0.37.1

… and the second command:

# [2022-01-24 12:36] maxg@maxg-pc-mint ~/Downloads $ 
sudo apt install python3-pip python3-setuptools python3-wheel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-setuptools is already the newest version (45.2.0-1).
python3-wheel is already the newest version (0.34.2-1).
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.

Then tried another install:

# [2022-01-24 12:36] maxg@maxg-pc-mint ~/Downloads $ 
python3 install.py
/usr/local/lib/python3.8/dist-packages/_distutils_hack/__init__.py:36: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Detected Linux distribution Linux Mint 20.3

setuptools will be upgraded from version 60.1.0 to version 60.5.0
These Python3 packages will be upgraded for your user (i.e. not system-wide): pip, setuptools, wheel
The following command will be run:

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


Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting setuptools
  Using cached setuptools-60.5.0-py3-none-any.whl (958 kB)
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-21.3.1 setuptools-60.5.0 wheel-0.37.1
Restarting script using /usr/bin/python3
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Downloading https://launchpad.net/rapid/pyqt/0.9.28/+download/rapid-photo-downloader-0.9.28.tar.gz (8.44 MB)
Downloading.... done!
Loading new installer script version 0.3.15
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored
Traceback (most recent call last):
  File "/tmp/tmpowa40qno/f3ucB5EwiC", line 14605, in <module>
    main()
  File "/tmp/tmpowa40qno/f3ucB5EwiC", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "/tmp/tmpowa40qno/f3ucB5EwiC", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 71, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py

# [2022-01-24 12:37] maxg@maxg-pc-mint ~/Downloads $ 

I would not know where to look to figure this out.
I then thought maybe this virtual environment works:

# [2022-01-24 12:53] maxg@maxg-pc-mint ~/Downloads $ 
python3 -m venv VirtualPythonEnvironment
Error processing line 1 of /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib/python3.8/site.py", line 175, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Remainder of file ignored

… which did not work either.

This is the most useful thing (I think, by the sound of it) for this error…

… but I would’t know what to do with it, or whether it still applies or not.

[edit1] the longer I look at this, the less this is a RPD problem; it seems to be a fundamental Python3 problem. Even a reinstall did not fix it… looks like rebuilding the machine eventually. [/edit1]

[edit2]I have followed this suggestion:

changing from this:

import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'local')  == 'local'; enabled and __import__('_distutils_hack').ensure_shim(); 

to:

import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim();

… and get now only a minimum set of errors:

# [2022-01-25 12:19] maxg@maxg-pc-mint ~/Downloads $ 
sudo nano /usr/local/lib/python3.8/dist-packages/distutils-precedence.pth
# [2022-01-25 12:20] maxg@maxg-pc-mint ~/Downloads $ 
python3 install.py 
/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
install.py:119: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  pip_version = StrictVersion(pip.__version__)
install.py:140: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  unknown_version = LooseVersion('0.0')
install.py:2173: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  if have_pip and pip_version >= StrictVersion('9.0.0'):
install.py:321: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
  return LooseVersion(v)
Detected Linux distribution Linux Mint 20.3
Downloading https://launchpad.net/rapid/pyqt/0.9.28/+download/rapid-photo-downloader-0.9.28.tar.gz (8.44 MB)
Downloading.... done!
Loading new installer script version 0.3.15
Traceback (most recent call last):
  File "/tmp/tmpklgrtk7_/hR2S8BjTDC", line 14605, in <module>
    main()
  File "/tmp/tmpklgrtk7_/hR2S8BjTDC", line 4148, in main
    packages, local_pip = pip_packages_required(distro_details.distro)
  File "/tmp/tmpklgrtk7_/hR2S8BjTDC", line 665, in pip_packages_required
    import setuptools
  File "/home/maxg/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 71, in do_override
    ensure_local_distutils()
  File "/home/maxg/.local/lib/python3.8/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py
# [2022-01-25 12:20] maxg@maxg-pc-mint ~/Downloads $ 

Any hints appreciated.
[edit 2]