Jagadeesh
Jagadeesh

Reputation: 149

Not able to get python version even after setting pyenv global version

I have installed pyenv-win for windows, also removed the normal python path from PATH environment variable.

Then, I have installed 2 versions of python(3.6.8 and 3.8.0) using "pyenv install ". enter image description here

Applied pyenv global version as running the command "pyenv global 3.6.8", when I run "pyenv versions", it is showing 3.6.8 is the global version.

But when I run "python --version" nothing is getting displayed and so I can't run any python file". I have also run "pyenv rehash" as well. Also, I have added /.pyenv/pyenv-win/shims and bin as well in the PATH environment variable.

I need your help here. Any leads would be appreciated, thank you.

Upvotes: 6

Views: 5081

Answers (1)

nohehf
nohehf

Reputation: 435

I think that you sould disable some aliases (see step n°3)

Here is how I installed pyenv-win, i had the same issue:

1 - Uninstall Python (your current version when you type the command python -V)

2 - Install pyenv-win and add it to the PATH (here are some optional steps to install it via chocolatey, which adds it directly to the PATH)

2.2 - Install chocolatey

2.3 - In an administrator powershell run: choco install pyenv-win

3 - Start menu (windows key) -> Manage application execution aliases -> disable aliases related to python here it's in french but it should be similar

4 - install the desired python version via pyenv: pyenv install DESIRED VERSION NUMBER

5- run pyenv rehash

6 - set it as global pyenv global DESIRED VERSION NUMBER

7 - you sould see the desired version by running the command python -V

Upvotes: 3

Related Questions