-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"workon" command has no effect after second call #25
Comments
Having to use the call operator suggests that a change of scope has occurred. What directory is your 'Envs' directory stored in? I'm getting different behavior for PS 7 and PS 5 depending on whether I invoke them in Windows Terminal or standalone. Location of 'Envs' is one of them. |
I did not put any explicit environment to change the "Envs", it's at: |
Hi @zeroxia |
you can also just use the same activation as in mkvirtualenv at line 103ff: $VEnvScritpsPath = Join-Path $NewEnv "Scripts"
$ActivatepPath = Join-Path $VEnvScritpsPath "activate.ps1"
. $ActivatepPath The Import-Module fct only executes once per shell session apparently. |
my system: windows 10:
powershell version:
Version : 5.1.19041.1023
I use
pyenv-win
to install: 3.8.10And put the "
VirtualEnvWrapper.psm1
" at: "$mydocuments\WindowsPowerShell\Modules
".Added these to
Profile.ps1
:Restarted powershell, execute
mkvirtualenv t1
, I can enter(t1)
virtualenv.then execute
deactivate
, virtualenv is deactivated, all is good.Then I type
workon t1
again, prompt does not have(t1)
prefix, and thepython
command is still the global one, at this point, if I executedeactivate
, this is reported as not recognized.I have to edit the
VirtualEnvWrapper.psm1
:In the function
function Workon
, change this line:To this:
Now everything works, I can
workon t1
,deactivate
,workon t1
, all is good.Just don't know the root cause, I'm completely noob with powershell.
The text was updated successfully, but these errors were encountered: