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

Problems with poetry and incorrect python version #549

Closed
ColdTeapot273K opened this issue Jan 21, 2022 · 2 comments
Closed

Problems with poetry and incorrect python version #549

ColdTeapot273K opened this issue Jan 21, 2022 · 2 comments

Comments

@ColdTeapot273K
Copy link

ColdTeapot273K commented Jan 21, 2022

Environment:
clearml==1.1.6
clearml-agent==1.1.1
poetry==1.1.12
pyenv==2.2.3
OS==4.14.256-197.484.amzn2.x86_64


The problem:
If I override system python with arbitrary python version using pyenv with pyenv global ..., and configure poetry as package manager in clearml.conf, a clearml-agent worker can crash on startup because it tries to link to system python, rather than pyenv python, which is easily incompatibe with dependencies.

E.g. Amazon Linux 2 standard python is 3.7 while fresh numpy requires python 3.9:

image

This is not solved by pointing python_binary: in clearml.conf to the pyenv python binary explicitly, see #523 (comment)


Solution:

I've tracked the issue to poetry repo, e.g. python-poetry/poetry#4199, python-poetry/poetry#4852 among others. The problem is, poetry with the new installer (install-poetry.py) doesn't respect pyenv global setting untill explicitly told to use that python in the current session via poetry use ....
Now, we cannot explicitly add any shell commands on clearml-agent startup (poetry use ...) unless we use docker (at least i didn't found any other way).
And poetry + docker don't play together well (besides docker would be overkill to use for any task).

What can be done is:

  1. either using unstable poetry 1.2 patched with Add (experimental) option to use current active python to create venv ("pyenv way") python-poetry/poetry#4852
  2. or, more stable way - use poetry installed with deprecateed installer (the get-poetry.py, not the install-poetry.py)

Maybe add some note to clearml docs?

@jkhenning
Copy link
Member

Hi @ColdTeapot273K,

Thanks for sharing such a detailed description and possible solutions 👍

Maybe add some note to clearml docs?

I think the FAQ is a good place to start, WDTY?

@ainoam
Copy link
Collaborator

ainoam commented Jan 25, 2022

@ColdTeapot273K I've taken the liberty to add your comments here, Makes 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

3 participants