virtualenv 激活不起作用

2024-04-09

我正在尝试创建一个虚拟环境来测试 api。

我可以使用以下方式创建环境virtualenv test,然后我可以 cd 进入它。当我尝试跑步时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,它用Windows Powershell取代了cmd。我的 virtualenv 在 cmd 上工作得很好,所以我怀疑这可能与 Powershell 的工作方式有关。

如何激活虚拟环境?


如果你按WindowsKey + R,然后输入cmd当该框出现时,它应该显示命令行界面而不是 powershell!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

virtualenv 激活不起作用 的相关文章

随机推荐