14

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:\Users\xxx\.pyenv\pyenv-win\version)

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

4 Answers 4

26

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

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

1 Comment

Step 3 was the solution, otherwise Store was getting launched
5

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

Comments

1

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

Comments

1

Remove all python versions (like 3.8.4 in your case) not installed using pyenv. I did using Control Panel in Windows. Then what you set as the global version using pyenv will be the true global version.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

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.