I am having a trouble to deploy my Django project due to Python version differences, so I want to update its version on AWS (16.04.4).
I currently have a virtual environment with Python 3.5, so I am trying to create the new one with Python 3.6. So far, I did:
$ source oldenv/bin/activate $ pip freeze > requirements.txt $ deactivate $ sudo apt-get install python3.6 $ python3.6 -m venv newenv
And, I got an error:
'-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Some answers recommend using without-pip, but I want to recover packages by
$ newenv/bin/pip install -r requirements.txt
So, it does not sound like a good idea. What to do?