running "pyenv --version" returned "PYENV variable is not set, recommended to set the…
- User
running "pyenv --version" returned "PYENV variable is not set, recommended to set the variable. PYENV_ROOT variable is not set, recommended to set the variable. PYENV_HOME variable is not set, recommended to set the variable. pyenv 3.1.1"
- Assistant
It looks like you're getting advice to set some environment variables related to your
pyenvinstallation, even though you successfully retrieved the version ofpyenv.Here's a breakdown of what these environment variables are and how you can set them:
-
PYENV:
- This variable is not typically used or required by
pyenvitself. Therefore, you can generally ignore any messages related toPYENV.
- This variable is not typically used or required by
-
PYENV_ROOT:
- This variable sets the directory where
pyenvwill store its data, including all Python versions and related shims. - By default,
pyenvuses~/.pyenvas its root directory. If you installedpyenvsomewhere else, you should set to that directory.
- This variable sets the directory where
-
- User
I ran "pyenv version" and got "No global/local python version has been set yet. Please set the global/local version by typing: pyenv global pyenv global 3.7.4 pyenv local pyenv local 3.7.4"
- Assistant
The message you're seeing indicates that you haven't set a default Python version to use with
pyenvyet. This is crucial becausepyenvrelies on this setting to know which version of Python to use by default globally or in a specific directory (locally).Here's how to set the Python version using
pyenv:Setting a Global Python Version
The global version is used across all directories unless overridden by a local version.