morning! I have a small installation problem. Pref...
# prefect-community
m
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
maybe try to run prefect in venv? https://docs.python.org/3/library/venv.html
πŸ™Œ 1
πŸ‘ 1
t
For managing python versions on your machine pyenv is great. Then i’d recommend poetry for creating and managing venv’s.
πŸ™Œ 1
m
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
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
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
Ubuntu 20.04 is also available on AWS EC2 - much easier to work with, but it's up to you
m
ok thanks a lot
πŸ™Œ 1
r
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
yeah all of that is correct but 3.7 should be fine and it's pre installed