Skip to content

Switch to Python 3

Dario edited this page Dec 4, 2020 · 7 revisions

Since version 0.3.0 Medusa supports Python version 3.6 and newer. As Python 2.7 will reach its EOL in 2020 we recommend to switch to Python 3 as soon as possible. For security reasons we won't be providing support for Python 2.7 after its EOL date.

Ubuntu

  1. Install Python 3.6 if you haven't already:

    Follow this well written guide over at Real Python.

  2. Update your systemd script: Systems with systemd.

Debian

  1. Install Python 3:

    Debian 9 and newer:

    sudo apt update
    sudo apt install python3
    

    Debian 7.0 - 8.0:

    Install from source. Follow this well written guide over at Real Python.

  2. Update your daemon:

    Debian 8.0 and newer:

    Update your systemd script: Systems with systemd.

    Debian 7.0:

    Update your initd script: Systems with SysVinit.

CentOS

  1. Install Python 3 if you haven't already:

    Follow this well written guide over at Real Python.

  2. Update your daemon:

    CentOS 7 and newer:

    Update your systemd script: Systems with systemd.

    CentOS 6:

    Update your initd script: Systems with SysVinit.

Systems with systemd

  1. Open your systemd script located at:
    /etc/systemd/system/medusa.service
    
  2. Replace all mentions of python2.7 with python3 and save.
  3. Reload systemd daemon:
    sudo systemctl daemon-reload
    
  4. Restart Medusa as you'd normally do:
    sudo systemctl restart medusa
    

Systems with SysVinit

  1. Open your init.d script located at:
    /etc/init.d/medusa
    
  2. Replace all mentions of python2.7 with python3 and save.
  3. Update and restart the service
    sudo update-rc.d medusa defaults
    sudo service medusa start