Any proper working manual for upgrade python2 to python 3.8?

I just ran so many commands to upgrade python 2 to 3.8 using different articles.

but not succeed. So I would like to see proper step by step instruction to upgrade python and incorporate with bench.

Would your guys have it?

In theory, all you need is

cd ~/frappe-bench
bench migrate-env python3
bench update --reset

I’ll recommend using py 3.7 latest.

2020-12-14 - All the tests run for py 3.7

1 Like

sanath@vmi322735:~$ cd frappe-bench
sanath@vmi322735:~/frappe-bench$ bench migrate-env python3
DEBUG:bench.utils:Clearing Redis Cache…
$ /usr/bin/redis-cli -p 13000 FLUSHALL
DEBUG:bench.utils:Clearing Redis DataBase…
$ /usr/bin/redis-cli -p 13000 FLUSHDB
DEBUG:bench.utils:Backing up Virtual Environment
DEBUG:bench.utils:Setting up a New Virtual /usr/bin/python3 Environment
$ /usr/local/bin/virtualenv --python /usr/bin/python3 /home/sanath/frappe-bench/env
Already using interpreter /usr/bin/python3
Using base prefix ‘/usr’
New python executable in /home/sanath/frappe-bench/env/bin/python3
Also creating executable in /home/sanath/frappe-bench/env/bin/python
Installing setuptools, pip, wheel…
$ /home/sanath/frappe-bench/env/bin/pip install -q -U -e apps/frappe -e apps/erpnext -e apps/hire_purchase
DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.
DEBUG:bench.utils:Migration Successful to /usr/bin/python3

but still showing my python version is 2.7

root@vmi322735:~# python -V
Python 2.7.13

Migration Successful to /usr/bin/python3
The app environment is using python3.5 - but the OS will not remove python2.7 since MANY apps rely on that.
You can run these…to check

python -V
python3 -V
1 Like

Would you please tell me how to move python 3.5.3 to 3.7?

I used this article to update to Python 3.7 on Debian 9: How To Install Python 3.7 on Ubuntu, Debian & LinuxMint - TecAdmin

Followed by: 1. bench migrate-env python3.7

Hope this helps.


Make sure to use bench migrate-env python3.7 if you have followed How To Install Python 3.7 on Ubuntu, Debian & LinuxMint - TecAdmin
As bench migrate-env python3 will still point to version 3.6.
Once after this please do bench setup requirements so that frappe gets installed
After this go with bench update or bench update --reset