pyenv-win / pyenv-win-venv

A CLI to manage virtual envs with pyenv-win
Apache License 2.0
78 stars 8 forks source link

env is set with the host %PYTHONPATH% python version instead of the desired version #20

Closed maxenceleduc92 closed 8 months ago

maxenceleduc92 commented 9 months ago

Hi, I've got python installed on my PC with %PYTHONPATH% set to a directory with the 3.7.4 version.

pyenv install 3.8.5 successfully installs v3.8.5 in "$HOME.pyenv\pyenv-win\versions\3.8.5"

But when installing a new virtual environment with pyenv-venv, it still uses the 3.7.4 version instead of the 3.8.5:

PS C:\WINDOWS\system32> pyenv-venv.ps1 install 3.8.5 env
Installing env: env using Python v3.8.5

PS C:\WINDOWS\system32> pyenv-venv.ps1 activate env

(env) PS C:\WINDOWS\system32> python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

PS C:\WINDOWS\system32 C:\Users\XXXX\.pyenv-win-venv\envs\env\Scripts\python.exe
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
maxenceleduc92 commented 8 months ago

The solution was to go to 'Manage App Execution Aliases' in Windows Settings and turn off 'App Installer' for python.

hj24 commented 6 days ago

not work for me https://github.com/pyenv-win/pyenv-win-venv/issues/32