我正在尝试创建一个虚拟环境来测试 api。
我可以使用 virtualenv test
很好地创建环境,然后我可以进入它。当我尝试运行 activate
时,出现此错误:
PS C:\Users\Bright Bridge\Desktop\autocomplete_demo\Scripts> activate
activate : The term 'activate' 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.
At line:1 char:1
+ activate
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (activate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command activate was not found, but does exist in the current location. Windows PowerShell does not load commands from the current
location by default. If you trust this command, instead type: ".\activate". See "get-help about_Command_Precedence" for more details.
我最近更新了 windows,并将 cmd 替换为 Windows Powershell。我的 virtualenv 在 cmd 上运行良好,所以我怀疑它可能与 Powershell 做事的方式有关。
如何激活 virtualenv?
原文由 wanderer0810 发布,翻译遵循 CC BY-SA 4.0 许可协议
如果你按
WindowsKey + R
,然后输入cmd
当框出现时,它应该调出命令行界面而不是 powershell!