在Windows10 PowerShell中激活虚拟环境时,遇到了一个错误:
PS C:\Users\sunil\Desktop\my_projects> .\venv\Scripts\activate.ps1
.\venv\Scripts\activate.ps1 : The term '.\venv\Scripts\activate.ps1' is
not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.即使用这种方式:
PS C:\Users\sunil\Desktop\my_projects\venv> .\Scripts\activate
Program 'activate' failed to run: No application is associated with the
specified file for this operationAt line:1 char:1
+ .\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~.发布于 2022-11-30 12:37:53
如果是Windows,请转到Path= "venv\Scripts“
"venv“是你虚拟环境的名字。然后执行以下命令:
set-Executionpolicy -Executionpolicy重签名的-Scope CurrentUser
现在键入activate (可选:按选项卡)并按返回
IT将被激活!
https://stackoverflow.com/questions/63413451
复制相似问题