Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playbook is compiling and installing a whole version of Python #187

Open
chriscn opened this issue Aug 8, 2024 · 1 comment
Open

Playbook is compiling and installing a whole version of Python #187

chriscn opened this issue Aug 8, 2024 · 1 comment

Comments

@chriscn
Copy link

chriscn commented Aug 8, 2024

I've tried this on a few different distros (Ubuntu 22.04, 24.04 and Debian 12) and each time it fails with the following:

TASK [paperless_ngx.paperless_ngx : Setup python version used in paperless-ngx venv] *******************************************************************************************************************
included: /Users/ccn510/.ansible/roles/paperless_ngx.paperless_ngx/tasks/base_dependencies/python.yml for paperless.nethercott.co.uk

TASK [paperless_ngx.paperless_ngx : Check if python is already installed with correct version] *********************************************************************************************************
ok: [paperless.nethercott.co.uk] => {"changed": false, "cmd": "/opt/python/3.11/bin/python3.11 --version", "failed_when_result": false, "msg": "[Errno 2] No such file or directory: b'/opt/python/3.11/bin/python3.11'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

TASK [paperless_ngx.paperless_ngx : Setting python version] ********************************************************************************************************************************************
ok: [paperless.nethercott.co.uk] => {"ansible_facts": {"_python_wanted_version_specific_installed": false}, "changed": false}

/opt/ on the remote host is indeed empty. I'd like to ask if we could take a look at this part of the code as I think it's madness that the playbook is compiling versions of Python from scratch. Surely a symlink is what you're after? Would be interested in the thought process behind this.

@stevenengland
Copy link
Collaborator

Hi @chriscn , thank you for bringing this up. For sure an existing python installation is preferred. And if there is a directory containing python with the correct version then you can change the corresponding variable paperless_ngx_dir_python. Often it is /opt/python.

I ended with this approach since there were constellations when which led to wrong results and when there were no suitable installation candidates for the distro/version in use. So my approach was:
Either tell the runbook where the python with correct version is sitting or it will be installed for you.

Maybe it is not the most elegant way but since I switched to this mechanism I had no complaints anymore about failing python things.

Does this make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants