pyenv global interpreter not working on windows10

Question:

I have just installed pyenv following the installation guide pyenv-win, things goes smoothly, but i could not make the pyenv global python as the global interpreter

I have rehashed after installation using pyenv rehash

PS D:> pyenv versions
  3.5.1
  3.6.2
  3.7.7
* 3.8.2 (set by C:Usersxxx.pyenvpyenv-winversion)

results

> python --version
> 3.8.4

# expected
> 3.8.2

therefore, I am not able to use virtualenv with the pyenv installed python interpreter

virtualenv py382-djangodev --python=3.8.2
The path 3.8.2 (from --python=3.8.2) does not exist
Asked By: DatascienceGeeks

||

Answers:

In windows NT, the PATH variable is a combined result of the system and user variables:

The Path is constructed from the system path, which can be viewed in
the System Environment Variables field in the System dialog box. The
User path is appended to the system path

Shims PATH are defined in the user variables, so make sure your host python interpreter path is not defined in your system path

Answered By: minglyu

I had the same issue which I finally solved:

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

Answered By: nohehf

Deinstalling everything connected to python (except pyenv) and using pyenv only worked for me.

Answered By: JosipPardon
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.