I am trying to get pyenv up and running (Mac OS X), so I can use tox/detox to test code vs. multiple python environments. I was able to install multiple python3 versions, and then I used pyenv global
on all the versions. After doing that, pyenv versions
returns this list:
system
* 3.2.6 (set by /Users/Workspace/.pyenv/version)
3.3.6
3.4.6
3.5.3
3.6.1
However, only 3.4 and 3.5 are recognized (along with 2.7.8, which I believe is 'system'):
Geoffreys-MBP:pydnmr-tox Workspace$ python --version
Python 2.7.8
Geoffreys-MBP:pydnmr-tox Workspace$ python3.2 --version
-bash: python3.2: command not found
Geoffreys-MBP:pydnmr-tox Workspace$ python3.3 --version
-bash: python3.3: command not found
Geoffreys-MBP:pydnmr-tox Workspace$ python3.4 --version
Python 3.4.3
Geoffreys-MBP:pydnmr-tox Workspace$ python3.5 --version
Python 3.5.2
Geoffreys-MBP:pydnmr-tox Workspace$ python3.6 --version
-bash: python3.6: command not found
Any ideas what is causing this behavior? tox/detox similarly cannot find any Python version besides 3.4/3.5.
Edit: it seems that pyenv has installed all the environments, but python3.x
commands weren't finding them. python3.4
and python3.5
were working because they found previous top-level installations. Results for pyenv which python3.x.y
vs. python3.x [--version]
shown below.
$ pyenv which python3.2
/Users/Workspace/.pyenv/versions/3.2.6/bin/python3.2
$ python3.2 --version
-bash: python3.2: command not found
$ python3.2
-bash: python3.2: command not found
pyenv which python3.3
/Users/Workspace/.pyenv/versions/3.3.6/bin/python3.3
$ python3.3 --version
-bash: python3.3: command not found
$ pyenv which python3.4
/usr/local/bin/python3.4 # old install
$ python3.4 --version
Python 3.4.3 # not 3.4.6 installed by pyenv
$ pyenv which python3.4.6
pyenv: python3.4.6: command not found
$ python3.4.6 --version
-bash: python3.4.6: command not found
$ pyenv which python3.5
/Users/Workspace/.pyenv/versions/3.5.3/bin/python3.5
$ python3.5 --version
Python 3.5.2 #Linked to my old 3.5.2 install instead of pyenv 3.5.3 install
$ pyenv which python3.6
/Users/Workspace/.pyenv/versions/3.6.1/bin/python3.6
$ python3.6 --version
-bash: python3.6: command not found
However, installing tox-pyenv as suggested in the answers below allowed tox to find and use all of these environments!
pyenv version
(without the s at the end) return? – Armelda(set by /Users/Workspace/Desktop/pydnmr-tox/.python-version)
– Heredia