Python update from old version of erpnext

Hello everyone, I am currently with a problem, what happens is that I need to update the python version of the system, and look in the forums that exist and recommended me to use the following commands

sudo apt-get install python3-dev
bench update
bench migrate-env python3

in my case I have to perform the bench update first since my version of bench does not have the command "migrate-env" and then do the migration, until there is all right but when I start the migration it gives me another problem in which it needed to change in the setup.py files both frappe and erpnext

Change pip.req    by:     pip._internal.req

With this change, I no longer get any error but now I try to start with bench update and it does not start the service