m

    Michele Rossi

    2 months ago
    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 πŸ™‚
    m

    Marcin Grzybowski

    2 months ago
    Tom Matthews

    Tom Matthews

    2 months ago
    For managing python versions on your machine pyenv is great. Then i’d recommend poetry for creating and managing venv’s.
    m

    Michele Rossi

    2 months ago
    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)
    Anna Geller

    Anna Geller

    2 months ago
    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

    2 months ago
    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
    Anna Geller

    Anna Geller

    2 months ago
    Ubuntu 20.04 is also available on AWS EC2 - much easier to work with, but it's up to you
    m

    Michele Rossi

    2 months ago
    ok thanks a lot
    Rajvir Jhawar

    Rajvir Jhawar

    2 months ago
    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
    m

    Michele Rossi

    2 months ago
    yeah all of that is correct but 3.7 should be fine and it's pre installed