Building AYON launcher on Linux Mint gives python error, even after installing 3.9 through Deadsnake

what would be the reason for this? If I read the bash script correctly, it seems that it uses python from an environment variable.

C:\home\hannah\Downloads\ayon-launcher> ./tools/make.sh build
>>> Using python - NOT FOUND You need Python 3.9 installed to continue.
C:\home\hannah\Downloads\ayon-launcher> python3 --version
Python 3.9.19
C:\home\hannah\Downloads\ayon-launcher> 

I believe the logic looks for the python executable, not python3 so you may need to alias it so that python refers to python3?

Yeah I used a timeshift and set different python versions up correctly.

Apparently the AYON launcher’s poetry setup doesn’t seem to like distutils, which is odd as that should be built in.
Terminal:

C:\home\hannah\ayon-launcher> ./tools/make.sh create-env
>>> Using python [ 3.9 ]
>>> Reading Poetry ... NOT FOUND
>>> Installing Poetry ...
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/home/hannah/ayon-launcher/.poetry/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.8.3): An error occurred. Removing partial environment.
Poetry installation failed.
See /home/hannah/ayon-launcher/poetry-installer-error-j5a8vpu6.log for error logs.
./tools/make.sh: line 147: /home/hannah/ayon-launcher/.poetry/venv/bin/python: No such file or directory
./tools/make.sh: line 148: [: -eq: unary operator expected
>>> Updating dependencies ...
./tools/make.sh: line 190: /home/hannah/ayon-launcher/.poetry/bin/poetry: No such file or directory
!!! Poetry environment installation failed

Logs:

Traceback (most recent call last):
  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/__main__.py", line 22, in <module>
    from pip._internal.cli.main import main as _main
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 11, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
    from pip._internal.build_env import get_runnable_pip
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/build_env.py", line 19, in <module>
    from pip._internal.cli.spinners import open_spinner
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
    from pip._internal.utils.logging import get_indentation
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 43, in <module>
    from pip._internal.locations import get_major_minor_version
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/locations/__init__.py", line 66, in <module>
    from . import _distutils
  File "/home/hannah/ayon-launcher/.poetry/venv/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py", line 20, in <module>
    from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'

Traceback:

  File "<stdin>", line 923, in main
  File "<stdin>", line 560, in run
  File "<stdin>", line 581, in install
  File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "<stdin>", line 653, in make_env
  File "<stdin>", line 639, in make_env
  File "<stdin>", line 352, in make
  File "<stdin>", line 375, in pip
  File "<stdin>", line 372, in python
  File "<stdin>", line 365, in run

@iLLiCiT Any chance you know this poetry installation error?


There seem to be other mentions online about the distutils.cmd error during poetry installs:

Which all appear to be Ubuntu related? It might be worth looking into those to see if they offer a solution. If they do, let us know what worked and we might be able to somehow ease the install or error messages for others in the future.

Hello, which version of Python are you using? We’re using 3.9.13 for all public builds.

[: -eq: unary operator expected

This is not that important, but is interesting.

I am using Python 3.9.19, perhaps I should downgrade 6 patches and try it again.

I got it to compile on the xfce version of mint just fine using the deadsnakes ppa,
(meaning, I used python 3.9.19 for this)
There’s some snags along the way

  • aliasing is nessecary to get the python command to pick python 3.9 after installing it.
# ~/.bashrc
alias python3=python3.9
alias python=python3

NOTE THAT THIS MIGHT BREAK STUFF. It is recommended that after building, this alias be undone, by setting it to

# ~/.bashrc
alias python3=python3 #(will make the alias go back to the default python3 package, making it keep up with python3 updates)
alias python=python3

Please do not forget to do this.

  • run source ~/.bashrc to reload.
  • distutils is on it’s way out, so it must be explicitly installed through sudo apt install python3.9-distutils to get the complete package
  • From that point onwards, pip can be installed from the bootstrap file listed in Installing Packages - Python Packaging User Guide as super user preferably.
    I chose to download the file, then explicitly run sudo python3.9 get-pip.py, and that will take care of that.
  • dependencies can then be installed using the make shell script, however, even after a succesful build, we still run into some Qt errors.
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin

So, it appears that for succesful build, there’s still this one dependency that is required.
It’s just a sudo apt install libxcb-cursor0 away.

I reinstalled depends and rebuilt just in case,
and was greeted with the beautiful login screen of the launcher, after running the
./build/output/ayon executable.
image
It is possible!

1 Like

Thanks for all the hard work, really appreciating it. Most of this can work but I have learned that pyenv is a much safer approach to this. As hardcoding your alias to python would be breaking things. (at least that is what happened to me.) So what I did was the following:

[Tutorial] Safely install and use other Python versions for coding (Mint 20 and 21, 64-bit) - Linux Mint Forums Follow this tutorial (not doing the going further part)

make sure to switch to the correct python version too. I used 3.9.13 as it is documented.

add deadsnakes to my package manager through:
sudo add-apt-repository ppa:deadsnakes/ppa

update my repositories:
sudo apt update

install distutils like you mentioned:
sudo apt install python3.9-distutils

install QT based on n0rbert´s response
https://askubuntu.com/questions/1335184/qt5-default-not-in-ubuntu-21-04:
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

install libxcb-cursor based on your suggestion:
sudo apt install libxcb-cursor0

from there on follow the tutorial of this guide (as of time writing this it is on commit 11e283b)

This should be the cleanest way of compiling AYON launcher for Linux mint 21.3 XFCE 4.18 to my knowledge. Any feedback is welcome :slight_smile:

I re-tested it from scratch, and it appears modifying ./bashrc didn’t do much.

I took a look inside the make.sh, and it appears that yesterday I had replaced all relevant python commands with python3.9, which is the simplest fix to do and it only requires a tiny bit of work.

I installed distutils as described, pip as described, and then only pip installed virtualenv.

I then ran:

./tools/make.sh create-env
./tools/make.sh install-runtime-dependencies
sudo ./tools/make.sh build

This doesn’t require any bashrc aliasing, which as Hannah said, is not a very good option if you forget to change it back, as it might indeed break stuff.

But surely, this worked again for me, even with python 3.9.19.
I didn’t need to go through the effort of downgrading to an earlier security patch.

Pyenv is the cleanest solution, although it requires the dependencies for building python to be installed as well.
If one uses pyenv, deadsnakes shouldn’t be an issue as well, since there’s no apt packages to install, rather just python to download and build, then switch to.

No Qt was required on my end!

1 Like

Indeed I managed to do it without the QT setups too after a fresh setup for different reasons.