Question

How to upgrade python version of droplet?

Posted March 14, 2021 104 views
Flask

Hi, How Can I upgrade the python version of the Linux droplet?

Apache/2.4.29 (Ubuntu) mod_wsgi/4.5.17 Python/2.7 configured

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there,

In case that you are using Ubuntu or Debian, you should be able to install Python 3 by running the following:

  • sudo apt update -y
  • sudo apt install python3.7

In case that you need to install a very specific version, you can follow the steps here:

https://www.digitalocean.com/community/questions/how-to-install-a-specific-python-version-on-ubuntu

Regards,
Bobby

  • Thanks for the reply. even though I changed the python version droplet error.log python shows the old python version,

    Another question is that when I change the flask app-related files how can I reload the project with new files?

    • Hi there,

      You can try adding TEMPLATES_AUTO_RELOAD=True to your config so that Flask will check for modifications of the template source and reload it automatically. By default, the value is None which means that Flask checks the original file only in debug mode.

      Regards,
      Bobby