Any suggestions on how you set the version of Python for pyenv?
E.g.
$ python3
Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13)
$ pyenv local
pyenv: no local version configured for this directory
$ pyenv local 3.6.0
pyenv: version `3.6.0' not installed
$ pyenv local v3.6.0:41df79263a11
pyenv: version `v3.6.0' not installed
Uninstalling pyenv To disable Pyenv managing your Python versions, simply remove the pyenv init invocations from your shell startup configuration. This will remove Pyenv shims directory from PATH , and future invocations like python will execute the system Python version, as it was before Pyenv.
Choose the version you wish to install from python.org. Right-click on the link titled Gzipped source tarball of the version you wish to install. From the popout menu choose Copy Link Location. These commands install your local version of python to /home/username/opt/python-3.10.
pyenv localSets a local application-specific Python version by writing the version name to a . python-version file in the current directory. This version overrides the global version, and can be overridden itself by setting the PYENV_VERSION environment variable or with the pyenv shell command.
pyenv global The global Python version is set in the /Users/matthewpowers/. pyenv/version file. Let's change the global version to 3.6.
You need to set up an virtual env first. For example, you can create a env called pyenv360 by
$ pyenv virtualenv 3.6.0 pyenv360
And set it as your default python for your folder my-folder by
$ cd my-folder
$ pyenv local pyenv360
By doing this, whenever you enter this folder, it'll start using pyenv360 which references python 3.6.0 in this case.
You can check if it's working by:
$ pyenv local
which should show pyenv360.
(Assuming you installed pyenv according to the official instructions.)
pyenv recognizes two kinds of Python installations:
system -- Python executables from PATH, regardless of their versionspyenv install under $PYENV_ROOT/versions
pyenv considers the former installations outside its control, so its commands don't take their versions into account when looking for a specific version.
To find out which installation, from pyenv's POV, your python3 refers to, check
pyenv versions
which python3 (and pyenv which python3 if the former points into <pyenv root>/shims/)
$PYENV_ROOT
If your 3.6.0 installation is indeed outside of pyenv's control, you need to select it with pyenv local system and make sure on your own that your PATH is arranged to point to it.
PATH first points to <pyenv_root>/shims and then to the correct python3
which -a python3 to quickly check thatIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With