https://prefect.io logo
Title
m

Michele Rossi

07/04/2022, 9:33 AM
morning! I have a small installation problem. Prefect requires Python 3.7+ and that's installed on our AWS Linux machines. Problem is, the default Python associated with the 'python' command is Python2. If you try to make Python3 the default incredibly you end up breaking YUM which relies on Python2. What's the best way to solve this problem? In short I need prefect to rely on Python 3 without altering the rest of my machines. I am no Python expert as you have probably guessed πŸ™‚
βœ… 1
m

Marcin Grzybowski

07/04/2022, 9:34 AM
maybe try to run prefect in venv? https://docs.python.org/3/library/venv.html
πŸ™Œ 1
πŸ‘ 1
t

Tom Matthews

07/04/2022, 10:30 AM
For managing python versions on your machine pyenv is great. Then i’d recommend poetry for creating and managing venv’s.
πŸ™Œ 1
m

Michele Rossi

07/04/2022, 10:33 AM
thanks a lot. I think I will be OK with VENV. All I need is to have the Prefect Agent run using Python 3 without making Python 3 the default version of Python for the whole system as that breaks YUM (I was really surprised to see that happening)
a

Anna Geller

07/04/2022, 12:06 PM
I recommend provisioning a VM with Ubuntu 20.04 LTS to avoid any headaches - this comes prepackaged with Python 3.8 so you don't have to fight with multiple Python versions. We also run our unit tests on the same Ubuntu version
m

Michele Rossi

07/04/2022, 12:08 PM
we use Amazon AWS Linux for all our instances. It also comes with Python pre-installed. Only problem is that Python 2 is installed too and it's the default
a

Anna Geller

07/04/2022, 12:12 PM
Ubuntu 20.04 is also available on AWS EC2 - much easier to work with, but it's up to you
m

Michele Rossi

07/04/2022, 12:12 PM
ok thanks a lot
πŸ™Œ 1
r

Rajvir Jhawar

07/04/2022, 1:05 PM
I am not sure if this still works since i don't use AWS that much anymore, but there is an extra package which should contain python3:
sudo amazon-linux-extras enable python3.8
sudo yum install python3.8
πŸ™Œ 1
m

Michele Rossi

07/04/2022, 1:06 PM
yeah all of that is correct but 3.7 should be fine and it's pre installed