zsh:未找到匹配项:requests[security] [英] zsh: no matches found: requests[security]

查看:57
本文介绍了zsh:未找到匹配项:requests[security]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行 python urllib2 脚本并收到此错误:

I am trying to run a python urllib2 script and getting this error:

InsecurePlatformWarning:真正的 SSLContext 对象不可用.这会阻止 urllib3 正确配置 SSL,并可能导致某些 SSL 连接失败.有关详细信息,请参阅 https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

在谷歌搜索错误解决方案后,堆栈溢出是下载请求的安全包:
pip install requests[security]

After googling the error the solution, on stack overflow is to download requests' security package:
pip install requests[security]

但是当我运行时出现错误...

But when I run that I get the error...

zsh:未找到匹配项:requests[security]

zsh: no matches found: requests[security]

任何人都知道为什么 zsh 没有选择这个库,它安装/升级请求很好,我不知道为什么这不起作用

Anyone know why zsh isn't picking up this library, it installs/upgrades requests just fine, I don't know why this isn't working

我在 Debian 服务器上运行它...

I am running this on a Debian Server...

推荐答案

zsh 使用 用于通配/模式匹配的方括号.

这意味着如果您需要将文字方括号作为参数传递给命令,则需要对它们进行转义或像这样引用参数:

That means that if you need to pass literal square brackets as an argument to a command, you either need to escape them or quote the argument like this:

pip install 'requests[security]'

如果您想永久禁用 pip 命令的globbing,您可以通过将其添加到您的 ~/.zshrc 中来实现:

If you want to disable globbing for the pip command permanently, you can do so by adding this to your ~/.zshrc:

alias pip='noglob pip'

这篇关于zsh:未找到匹配项:requests[security]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆