-
Notifications
You must be signed in to change notification settings - Fork 28
Description
my system: windows 10:
> [System.Environment]::OSVersion.Version
Major Minor Build Revision
----- ----- ----- --------
10 0 19041 0
powershell version: Version : 5.1.19041.1023
I use pyenv-win to install: 3.8.10
And put the "VirtualEnvWrapper.psm1" at: "$mydocuments\WindowsPowerShell\Modules".
Added these to Profile.ps1:
$PowerShellPath = Split-Path $PROFILE.CurrentUserAllHosts
Import-Module $PowerShellPath\Modules\VirtualEnvWrapper.psm1
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 the python command is still the global one, at this point, if I execute deactivate, this is reported as not recognized.
I have to edit the VirtualEnvWrapper.psm1:
In the function function Workon, change this line:
Import-Module $activate_path
To this:
& $activate_path
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.