pyenv installs multiple pythons, but recognizes only some -


i trying pyenv , running (mac os x), can use tox/detox test code vs. multiple python environments. able install multiple python3 versions, , used pyenv global on versions. after doing that, pyenv versions returns list:

  system * 3.2.6 (set /users/workspace/.pyenv/version)   3.3.6   3.4.6   3.5.3   3.6.1 

however, 3.4 , 3.5 recognized (along 2.7.8, believe '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 causing behavior? tox/detox cannot find python version besides 3.4/3.5.

edit: seems pyenv has installed environments, python3.x commands weren't finding them. python3.4 , python3.5 working because found previous top-level installations. results pyenv python3.x.y vs. python3.x [--version] shown below.

$ pyenv 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 python3.3 /users/workspace/.pyenv/versions/3.3.6/bin/python3.3 $ python3.3 --version -bash: python3.3: command not found $ pyenv python3.4 /usr/local/bin/python3.4  # old install $ python3.4 --version python 3.4.3              # not 3.4.6 installed pyenv $ pyenv python3.4.6 pyenv: python3.4.6: command not found $ python3.4.6 --version -bash: python3.4.6: command not found $ pyenv python3.5 /users/workspace/.pyenv/versions/3.5.3/bin/python3.5 $ python3.5 --version python 3.5.2  #linked old 3.5.2 install instead of pyenv 3.5.3 install $ pyenv 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 suggested in answers below allowed tox find , use of these environments!

pyenv interpreter discovery not integrated tox core (yet). work because tox happens find unaware discovery methods applies.

there 2 ways make work consistently:

  1. tell pyenv interpreters in context call tox. e.g. in project want run tox pyenv local system 3.2.6 3.3.6 3.4.6 3.5.3 3.6.1 tox should find of them. if want default wherever you cant set pyenv global that. first in list interpreter invoked, when calling python, others should active , therefore discoverable tox.

  2. if doesn't whatever reason or bit more automatic: there plugin - tox-pyenv takes care of discovery


Comments