pyenv-win / pyenv-win-venv

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

Deactivate works in Powershell, not in Command Prompt #11

Closed SnakyGrain closed 1 year ago

SnakyGrain commented 1 year ago

Hi,

It might be that the plugin is designed to work in Powershell, and not in the Command Prompt window - but the deactivate command does not seem to work in the Command Prompt window: the env-name is still prefixed to the prompt, and changing directory does not change the python version. In case that's not clear - I have a folder set up in pyenv as a 3.9.13 install, while my global install is 3.7.9. If I am in that folder, and activate the environment called "env-name", in Powershell, things look something like this:

(env-name) PS: E:\Python\project> python -V Python 3.9.13 (env-name) PS: E:\Python\project>pyenv-venv deactivate PS: E:\Python\project>python -V Python 3.9.13 PS: E:\Python\project>cd .. PS: E>Python>python -V 3.7.9

In the command prompt window: (env-name) E:\Python\project> python -V Python 3.9.13 (env-name) E:\Python\project>pyenv-venv deactivate (env-name) E:\Python\project>python -V Python 3.9.13 (env-name) E:\Python\project>cd .. (env-name) E:\Python>python -V Python 3.9.13

Also I had to run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser in a powershell window followed by UnBlock File for both of the .ps1 scripts in the bin directory to get it running

arzkar commented 1 year ago

Hey,

I pushed a fix for this and released a new version as well. Update the CLI using pyenv-venv update self

SnakyGrain commented 1 year ago

That was quick! Many thanks - all working fine now!