This does not work
shishir@localhost: ~
$ pyenv versions
system
* 3.4.2 (set by /Users/shishir/.pyenv/version)
shishir@localhost: ~
$ pyenv global system
pyenv: version `system' not installed
shishir@localhost: ~
$ pyenv
pyenv 20150204
Usage: pyenv <command> [<args>]
Some useful pyenv commands are:
commands List all available pyenv commands
local Set or show the local application-specific Python version
global Set or show the global Python version
shell Set or show the shell-specific Python version
install Install a Python version using python-build
uninstall Uninstall a specific Python version
rehash Rehash pyenv shims (run this after installing executables)
version Show the current Python version and its origin
versions List all Python versions available to pyenv
which Display the full path to an executable
whence List all Python versions that contain the given executable
See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/yyuu/pyenv#readme
Unfortunately, this is not a new issue. To this day, pyenv global <version name> seems to be a noop.
~ $ pyenv install 2.7.9
Downloading Python-2.7.9.tgz...
-> https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
Installing Python-2.7.9...
Installing setuptools from https://bootstrap.pypa.io/ez_setup.py...
Installing pip from https://bootstrap.pypa.io/get-pip.py...
Installed Python-2.7.9 to /Users/[username]/.pyenv/versions/2.7.9
~ $ pyenv versions
* system (set by /Users/[username]/.python-version)
2.7.9
~ $ pyenv global 2.7.9
~ $ pyenv versions
* system (set by /Users/[username]/.python-version)
2.7.9
~ $ which python
/Users/[username]/.pyenv/shims/python
~ $ pyenv which python
/usr/bin/python
~ $ python --version
Python 2.7.5
~ $
Even a rehash did nothing:
~ $ pyenv global 2.7.9
~ $ pyenv versions
* system (set by /Users/[username]/.python-version)
2.7.9
I love the idea of pyenv, but it seems to be horribly, horribly broken.
...wait... I just realized something. I had a .python-version file sitting in ~:
~ $ rm .python-version
~ $ pyenv global 2.7.9
~ $ pyenv versions
system
* 2.7.9 (set by /Users/[username]/.pyenv/version)
For shits and giggles, I did another installation to see if it sticks, and it does!
~ $ pyenv install 3.4.3
Downloading Python-3.4.3.tgz...
-> https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
Installing Python-3.4.3...
Installed Python-3.4.3 to /Users/[username]/.pyenv/versions/3.4.3
~ $ pyenv versions
system
* 2.7.9 (set by /Users/[username]/.pyenv/version)
3.4.3
~ $ pyenv global 3.4.3
~ $ rm .python-version
rm: .python-version: No such file or directory
~ $ pyenv global 3.4.3
~ $ pyenv versions
system
2.7.9
* 3.4.3 (set by /Users/[username]/.pyenv/version)
~ $ python --version
Python 3.4.3
So, for about seven months, what was perplexing me was the presence of a .python-version file...
I propose the following feature: if a user does pyenv global <version> in a directory where a .python-version file exists, a warning should be given, something along the lines of:
pyenv: global version of <global_version> in <this directory> overridden by local version of <local_version>, supplied by ./.python-version
In the meantime, I've altered my PS1 slightly so that I always have the name of the pyenv version displayed. Check here for details.
@shishirsharma Looks weird. If the system version is visible via pyenv versions, it should be able to be used as a version. I couldn't reproduce the issue. Please let me know the output from PYENV_DEBUG=1 pyenv prefix system.
root@3161ef0662dc:~# pyenv versions
system
* 3.4.3 (set by /root/.pyenv/version)
root@3161ef0662dc:~# pyenv global system
root@3161ef0662dc:~# pyenv versions
* system (set by /root/.pyenv/version)
3.4.3
root@3161ef0662dc:~# pyenv --version
pyenv 20150326-2-gf0eeac6
Hi @yyuu
I have the same problem here, too. This is the output of the command you want:
ake-mbpr:shims ake$ pyenv prefix
/Users/ake/.pyenv/versions/2.7.9
ake-mbpr:shims ake$ pyenv prefix system
pyenv: version `system' not installed
ake-mbpr:shims ake$ pyenv versions
system
* 2.7.9 (set by /Users/ake/.pyenv/version)
ake-mbpr:shims ake$ pyenv global system
pyenv: version `system' not installed
Somehow it just works now. Will look into detail if I can reproduce the problem later and share it here.
@iamake Please gist the output from PYENV_DEBUG=1 pyenv prefix system once you can reproduce the behaviour.
I suspect this is due to what your $PATH is set to; I ran into this issue myself and found there were issues with my $PATH. I think what happens is that pyenv which attempts to look for python in whatever is first in your $PATH.
For me, that was /usr/sbin.
Output of PYENV_DEBUG=1 pyenv prefix system shows this to be the case:
❯ PYENV_DEBUG=1 pyenv prefix system
+ [pyenv:15] enable -f /home/aj/.pyenv/bin/../libexec/pyenv-realpath.dylib realpath
+ [pyenv:21] '[' -n '' ']'
++ [pyenv:25] type -p greadlink readlink
++ [pyenv:25] head -1
+ [pyenv:25] READLINK=/usr/sbin/readlink
+ [pyenv:26] '[' -z /usr/sbin/readlink ']'
+ [pyenv:50] '[' -z /home/aj/.pyenv ']'
+ [pyenv:53] PYENV_ROOT=/home/aj/.pyenv
+ [pyenv:55] export PYENV_ROOT
+ [pyenv:57] '[' -z '' ']'
++ [pyenv:58] pwd
+ [pyenv:58] PYENV_DIR=/home/aj/Code/yt
+ [pyenv:67] export PYENV_DIR
+ [pyenv:70] shopt -s nullglob
++ [pyenv:72] abs_dirname /home/aj/.pyenv/bin/pyenv
+++ [pyenv:36] pwd
++ [pyenv:36] local cwd=/home/aj/Code/yt
++ [pyenv:37] local path=/home/aj/.pyenv/bin/pyenv
++ [pyenv:39] '[' -n /home/aj/.pyenv/bin/pyenv ']'
++ [pyenv:40] cd /home/aj/.pyenv/bin
++ [pyenv:41] local name=pyenv
+++ [pyenv:42] resolve_link pyenv
+++ [pyenv:32] /usr/sbin/readlink pyenv
++ [pyenv:42] path=../libexec/pyenv
++ [pyenv:39] '[' -n ../libexec/pyenv ']'
++ [pyenv:40] cd ../libexec
++ [pyenv:41] local name=pyenv
+++ [pyenv:42] resolve_link pyenv
+++ [pyenv:32] /usr/sbin/readlink pyenv
+++ [pyenv:42] true
++ [pyenv:42] path=
++ [pyenv:39] '[' -n '' ']'
++ [pyenv:45] pwd
++ [pyenv:46] cd /home/aj/Code/yt
+ [pyenv:72] bin_path=/home/aj/.pyenv/libexec
+ [pyenv:73] for plugin_bin in '"${PYENV_ROOT}/plugins/"*/bin'
+ [pyenv:74] PATH=/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/usr/sbin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:76] export PATH=/home/aj/.pyenv/libexec:/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/usr/sbin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:76] PATH=/home/aj/.pyenv/libexec:/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/usr/sbin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:78] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d
+ [pyenv:79] '[' /home/aj/.pyenv '!=' /home/aj/.pyenv ']'
+ [pyenv:83] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks
+ [pyenv:84] for plugin_hook in '"${PYENV_ROOT}/plugins/"*/etc/pyenv.d'
+ [pyenv:85] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks:/home/aj/.pyenv/plugins/pyenv-pip-rehash/etc/pyenv.d
+ [pyenv:87] export PYENV_HOOK_PATH
+ [pyenv:89] shopt -u nullglob
+ [pyenv:92] command=prefix
+ [pyenv:93] case "$command" in
++ [pyenv:101] command -v pyenv-prefix
+ [pyenv:101] command_path=/home/aj/.pyenv/libexec/pyenv-prefix
+ [pyenv:102] '[' -z /home/aj/.pyenv/libexec/pyenv-prefix ']'
+ [pyenv:107] shift 1
+ [pyenv:108] exec /home/aj/.pyenv/libexec/pyenv-prefix system
+ [pyenv-prefix:13] '[' system = --complete ']'
+ [pyenv-prefix:18] '[' -n system ']'
+ [pyenv-prefix:19] OLDIFS='
'
+ [pyenv-prefix:20] IFS=:
+ [pyenv-prefix:21] export PYENV_VERSION=system
+ [pyenv-prefix:21] PYENV_VERSION=system
+ [pyenv-prefix:23] IFS='
'
+ [pyenv-prefix:28] PYENV_PREFIX_PATHS=()
+ [pyenv-prefix:29] OLDIFS='
'
+ [pyenv-prefix:30] IFS=:
+ [pyenv-prefix:31] for version in '${PYENV_VERSION}'
+ [pyenv-prefix:32] '[' system = system ']'
++ [pyenv-prefix:33] pyenv-which python
+ [pyenv-prefix:33] PYTHON_PATH=/usr/sbin/python
+ [pyenv-prefix:34] PYENV_PREFIX_PATH=/usr/sbin/python
+ [pyenv-prefix:42] '[' -d /usr/sbin/python ']'
+ [pyenv-prefix:45] echo 'pyenv: version `system'\'' not installed'
pyenv: version `system' not installed
+ [pyenv-prefix:46] exit 1
After I fixed my local $PATH, pyenv global system worked.
This was the output of pyenv prefix system:
❯ PYENV_DEBUG=1 pyenv prefix system
+ [pyenv:15] enable -f /home/aj/.pyenv/bin/../libexec/pyenv-realpath.dylib realpath
+ [pyenv:21] '[' -n '' ']'
++ [pyenv:25] type -p greadlink readlink
++ [pyenv:25] head -1
+ [pyenv:25] READLINK=/usr/bin/readlink
+ [pyenv:26] '[' -z /usr/bin/readlink ']'
+ [pyenv:50] '[' -z /home/aj/.pyenv ']'
+ [pyenv:53] PYENV_ROOT=/home/aj/.pyenv
+ [pyenv:55] export PYENV_ROOT
+ [pyenv:57] '[' -z '' ']'
++ [pyenv:58] pwd
+ [pyenv:58] PYENV_DIR=/usr
+ [pyenv:67] export PYENV_DIR
+ [pyenv:70] shopt -s nullglob
++ [pyenv:72] abs_dirname /home/aj/.pyenv/bin/pyenv
+++ [pyenv:36] pwd
++ [pyenv:36] local cwd=/usr
++ [pyenv:37] local path=/home/aj/.pyenv/bin/pyenv
++ [pyenv:39] '[' -n /home/aj/.pyenv/bin/pyenv ']'
++ [pyenv:40] cd /home/aj/.pyenv/bin
++ [pyenv:41] local name=pyenv
+++ [pyenv:42] resolve_link pyenv
+++ [pyenv:32] /usr/bin/readlink pyenv
++ [pyenv:42] path=../libexec/pyenv
++ [pyenv:39] '[' -n ../libexec/pyenv ']'
++ [pyenv:40] cd ../libexec
++ [pyenv:41] local name=pyenv
+++ [pyenv:42] resolve_link pyenv
+++ [pyenv:32] /usr/bin/readlink pyenv
+++ [pyenv:42] true
++ [pyenv:42] path=
++ [pyenv:39] '[' -n '' ']'
++ [pyenv:45] pwd
++ [pyenv:46] cd /usr
+ [pyenv:72] bin_path=/home/aj/.pyenv/libexec
+ [pyenv:73] for plugin_bin in '"${PYENV_ROOT}/plugins/"*/bin'
+ [pyenv:74] PATH=/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:76] export PATH=/home/aj/.pyenv/libexec:/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:76] PATH=/home/aj/.pyenv/libexec:/home/aj/.pyenv/plugins/python-build/bin:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/aj/.pyenv/shims:/home/aj/.pyenv/bin:/home/aj/.rbenv/shims:/home/aj/.rbenv/bin:/home/aj/.cask/bin:/usr/local/sbin:/usr/local/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
+ [pyenv:78] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d
+ [pyenv:79] '[' /home/aj/.pyenv '!=' /home/aj/.pyenv ']'
+ [pyenv:83] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks
+ [pyenv:84] for plugin_hook in '"${PYENV_ROOT}/plugins/"*/etc/pyenv.d'
+ [pyenv:85] PYENV_HOOK_PATH=:/home/aj/.pyenv/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks:/home/aj/.pyenv/plugins/pyenv-pip-rehash/etc/pyenv.d
+ [pyenv:87] export PYENV_HOOK_PATH
+ [pyenv:89] shopt -u nullglob
+ [pyenv:92] command=prefix
+ [pyenv:93] case "$command" in
++ [pyenv:101] command -v pyenv-prefix
+ [pyenv:101] command_path=/home/aj/.pyenv/libexec/pyenv-prefix
+ [pyenv:102] '[' -z /home/aj/.pyenv/libexec/pyenv-prefix ']'
+ [pyenv:107] shift 1
+ [pyenv:108] exec /home/aj/.pyenv/libexec/pyenv-prefix system
+ [pyenv-prefix:13] '[' system = --complete ']'
+ [pyenv-prefix:18] '[' -n system ']'
+ [pyenv-prefix:19] OLDIFS='
'
+ [pyenv-prefix:20] IFS=:
+ [pyenv-prefix:21] export PYENV_VERSION=system
+ [pyenv-prefix:21] PYENV_VERSION=system
+ [pyenv-prefix:23] IFS='
'
+ [pyenv-prefix:28] PYENV_PREFIX_PATHS=()
+ [pyenv-prefix:29] OLDIFS='
'
+ [pyenv-prefix:30] IFS=:
+ [pyenv-prefix:31] for version in '${PYENV_VERSION}'
+ [pyenv-prefix:32] '[' system = system ']'
++ [pyenv-prefix:33] pyenv-which python
+ [pyenv-prefix:33] PYTHON_PATH=/usr/bin/python
+ [pyenv-prefix:34] PYENV_PREFIX_PATH=/usr
+ [pyenv-prefix:42] '[' -d /usr ']'
+ [pyenv-prefix:43] PYENV_PREFIX_PATHS=("${PYENV_PREFIX_PATHS[@]}" "$PYENV_PREFIX_PATH")
+ [pyenv-prefix:50] IFS='
'
+ [pyenv-prefix:52] OLDIFS='
'
+ [pyenv-prefix:53] IFS=:
+ [pyenv-prefix:54] echo /usr
/usr
+ [pyenv-prefix:56] IFS='
'
So I'm running into a similar problem, although it only breaks when I try to load multiple versions and leave system as the last one:
~ pyenv global system
~ pyenv prefix
/usr
~ pyenv global 2.7.10 system
~ pyenv prefix
/home/rdu/difernan/.pyenv/versions/2.7.10:/home/rdu/difernan/.pyenv/versions/2.7.10
~ pyenv prefix system
/usr
~ pyenv global system 2.7.10
~ pyenv prefix
/usr:/home/rdu/difernan/.pyenv/versions/2.7.10
Same problem here
Any idea?
$ pyenv versions
system
* 2.7.10 (set by /home/flume-agent/.pyenv/version)
2.7.8
$ pyenv prefix
/home/flume-agent/.pyenv/versions/2.7.10
And then
$ python -V
Python 2.6.6
:-1:
@nanounanue what's output of echo $PATH and which python?
@aiguofer
The output are:
$ echo $PATH
/home/flume-agent/.pyenv/bin:/sbin:/bin:/usr/sbin:/usr/bin
$ which python
/usr/bin/python
weird, isn't it?
@nanounanue I think you're missing ~/.pyenv/shims as the first entry in your path.
Do you have eval "$(pyenv init -)" as the last line in your .bashrc/.zshrc?
Try running that to see if it helps.
It has to be the last line?
@nanounanue I don't think it _has_ to be last, but it needs to be after anything else that modifies PATH... it essentially sets the path and then calls a few other scripts to add auto-completion and create some commands.
if you also use the virtualenv plugin you'll also want to add eval "$(pyenv virtualenv-init -)"
I have both ... Any other idea?
Hmmm so apparently it needs to be in ~/.bash_profile and not ~/.bashrc.
After you add it, make sure you do source ~/.bash_profile
If that still doesn't work, try export PATH=~/.pyenv/shims:$PATH manually and see if it picks up the correct python with which python
I have it in .bash_profile, .zshrc and in .bashrc, let me try your suggestion, and I' ll come back to you
Mmmm it´s weird
I f I execute source ~/.bash_prifile it picks the right one.
I am switching from another user (I mean with sudo su) Could it be the problem?
That could be it. The shell only sees the current user's ENV, so if it's not installed in the other user it won't work there.
Suppose you are logged in as user a and it has pyenv installed in /home/a/.pyenv
Then you do sudo su b, if there is no /home/b/.pyenv then it's not going to work.
You would need pyenv installed on the user that you're currently logged in as, and the init lines in the same user's bash_profile
Are both users using bash? if so, you can delete .zshrc and remove the lines from .bashrc
I met same problems as @nanounanue do.
And fix it with leaving eval "$(pyenv init -)" as the last line in .zshrc
Thanks @aiguofer
People should know how their shell is configured....
People are having problem because of the following. Official install documentation is saying they should put eval "$(pyenv init -)" inside ~/.zshenv. However, many have $PATH set in their ~/.zshrc file. The problem lies in fact that ~/.zshenv is read before ~/.zshrc and therefore eval "$(pyenv init -)" doesn't affect $PATH.
So - the bottom line - you should set eval "$(pyenv init -)" wherever, but make sure it is executed after your path is set.
/etc/zshenv # Read for every shell
~/.zshenv # Read for every shell except ones started with -f
/etc/zprofile # Global config for login shells, read before zshrc
~/.zprofile # User config for login shells
/etc/zshrc # Global config for interactive shells
~/.zshrc # User config for interactive shells
/etc/zlogin # Global config for login shells, read after zshrc
~/.zlogin # User config for login shells
~/.zlogout # User config for login shells, read upon logout
/etc/zlogout # Global config for login shells, read after user logout file
@ZeKoU
So - the bottom line - you should set eval "$(pyenv init -)" wherever, but make sure it is executed after your path is set.
Please consider creating a PR to clarify this.
I have faced the same issue, and found that two pyenv installations were conflicting: ~/.pyenv and /usr/local/opt/pyenv because I have installed pyenv natively (on Mac OS X) and then installed it again using home-brew. Removing ~/.pyenv fixed the issue for me. Just FYI.
Well, pyenv shouldn't have been installed in both of those locations. ~/.pyenv is primarily a directory for storing a download cache, and installed versions of python. The only thing accomplished by deleting ~/.pyenv is getting rid of the Python interpreters installed by pyenv.
Whenever I install the most stable versions of both 2 and 3, pyenv correctly points at the version I set up the global with. However, system settings still override and my pre-installed python 2.7.10 version takes priority whenever running a script.
@darkkunai Probably you have "pyenv init" in your shell configuration file for interactive shells only. To make it working always, you have to have config for all shell processes including non-interactive one. In zsh, it's ~/.zshenv
Notice that maybe you set a local version python($ pyenv local 2.7.xxxx) somewhere instead of a global version($ pyenv global 3.5.xxxx).So it will stuck in the local version when you're in that position even if you set a global version.
To solve the problem, you have to delete .python_version in the path you set the local version. It works for me.
The pyenv configuration should write below your system python PATH configuration,like this:
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# pyenv configuration
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
# pyenv-virtualenv configuration
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
not like this:
# pyenv configuration
export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
# pyenv-virtualenv configuration
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
Gack! The previous post gave me cancer. Please learn markdown and/or code escapes for Git.
FreeBSD 11 installs both python2 and python3, but there's no defauly 'python' symlink (by design) to one of them, so pyenv doesn't find python and doesn't find SYSTEM version.
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python fixes this.
god that took a time to discover
I am moving back to Microsoft. This is FUCKING STUPID!!
Another option is that you may have entered into a virtualenv, deactivate it (or exit) then it will work correctly.
PS. Make sure that eval "$(pyenv init -)" was also run.
FreeBSD 11 installs both python2 and python3, but there's no defauly 'python' symlink (by design) to one of them, so pyenv doesn't find python and doesn't find SYSTEM version.
sudo ln -s /usr/local/bin/python3 /usr/local/bin/pythonfixes this.god that took a time to discover
You're right, this was more mysterious than it should have been (on Ubuntu 20.04, here).
Most helpful comment
...wait... I just realized something. I had a
.python-versionfile sitting in~:For shits and giggles, I did another installation to see if it sticks, and it does!
So, for about seven months, what was perplexing me was the presence of a
.python-versionfile...I propose the following feature: if a user does
pyenv global <version>in a directory where a.python-versionfile exists, a warning should be given, something along the lines of: