Python: How can I upgrade python version in pyenv-virtual-environment?

I have used pyenv

, pyenv-virtualenv

to control the python virtual environment.

I have a project running in a Python 3.4

virtual environment.

Thus, all installed packages ( pandas

, numpy

etc.) are not the newest version.

What I want to do is upgrade the version Python

from 3.4 to 3.6 and also upgrade the version of the other package to a higher one.

How can I do this easily?

+3


source to share


2 answers


Use pip freeze > requirements.txt

to keep a list of installed packages.

Create a new venv with python 3.6.



Install the saved packages with pip install -r requirements.txt

. When pip finds a universal wheel in the cache, it installs the package from the cache. Other packages will be downloaded, cached, built and installed.

+2


source


If you are using anaconda just type



conda install python == $ pythonversion $

+1


source







All Articles