python - virtualenv 激活不起作用

标签 python powershell virtualenv

我正在尝试创建一个虚拟环境来测试 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,并将 cmd 替换为 Windows Powershell。我的 virtualenv 与 cmd 配合得很好,所以我怀疑这可能与 Powershell 做事的方式有关。

如何激活虚拟环境?

最佳答案

如果您按下 WindowsKey + R,并在出现框时键入 cmd,它应该会调出命令行界面而不是 powershell!

关于python - virtualenv 激活不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44194427/

相关文章:

python - pip-selfcheck.json 与 virtualenv

python - 在 Ubuntu 上通过 virtualenv 中的设置工具安装 Numpy 时出错

java - 如何使用 Jython/PyDev 修复 Eclipse Kepler/Luna 中的 UnsupportedCharsetException?

python - 无法将模型从 Keras 转换为 Tensorflow

powershell - DynamoDB API 过滤扫描不返回任何结果

python - 当我在 virtualenv 中时无法 pip 安装包

python - 使用 Pyspark 创建基于分组依据的新列

python - 使用 ruamel 在 yaml 中插入节点

powershell - 如何在 Powershell 中打开文件夹

command-line - 如何从命令行运行 Exchange 2007 PowerShell 脚本?