往现有虚拟环境中增加python3.9.6
一、
python-3.9.6-amd64.exe安装到
E:\software\Python\Python396
二、
cd E:\software\Python\Python396
PS E:\software\Python\Python396> pip -V
pip 21.1.3 from e:\software\python\python396\lib\site-packages\pip (python 3.9)
PS E:\software\Python\Python396> pip install virtualenv(即使其他版本安装过,这里也必须重新安装,否则会出现,切换到3.9.6版本)
PS
E:\software\Python\Python396> virtualenv -v
find interpreter for spec PythonSpec(path=e:\software\python\python396\python.exe)
E:\software\Python\Python396> virtualenv E:\ENVS\python3.9.6
三、
修改C:\Users\Administrator\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1如下:
Set-Alias py3.6 E:\ENVS\python3.6\Scripts\activate.ps1
Set-Alias py3.13 E:\ENVS\python3.13\Scripts\activate.ps1
Set-Alias py3.8 E:\ENVS\python3.8\Scripts\activate.ps1
Set-Alias py3.9.6 E:\ENVS\python3.9.6\Scripts\activate.ps1
py3.8
效果如下