在Windows 10 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
+ ~~~~~~~~~~~~~~~~~~.
1条答案
按热度按时间watbbzwu1#
如果您运行的是Windows,则导航到
<venv>\Scripts
,其中<venv>
是虚拟环境的名称。然后,执行以下命令:键入
activate
并按回车键,您现在就可以使用虚拟环境了。