6

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.

5
  • Did you run github.com/pyenv-win/pyenv-win#finish-the-installation Commented Oct 31, 2020 at 15:23
  • yes @StefanWang, I am able to check "pyenv --version" and also "pyenv rehash", but not sure what rehash is doing, it is not returning anything, and also it completes very quickly. Commented Oct 31, 2020 at 15:39
  • ohh !!, now, it's working. But, I really did that because earlier also "pyenv versions" and "pyenv rehash" were working for me and also was able to set global version, the only issue is when I run "python --version" nothing comes. But now it is working, all I did is just ran the "follow the installation" steps again. Thank you @StefanWang Commented Oct 31, 2020 at 15:42
  • nice to hear that Commented Oct 31, 2020 at 15:42
  • For me a restart of the shell I was working in did the trick. Somehow the global instruction didn't take effect before. Commented Oct 13, 2022 at 15:41

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.