Warm tip: This article is reproduced from serverfault.com, please click

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

(python - zsh: no matches found: requests[security])

发布于 2015-05-29 22:06:32

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

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

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

但是当我运行时,我得到了错误...

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

任何人都知道zsh为什么不使用该库,它可以安装/升级请求,我不知道为什么这不起作用

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

Questioner
Kristen
Viewed
11
Lukas Graf 2015-05-30 06:23:08

zsh使用方括号进行匹配/模式匹配

这意味着如果你需要将文字方括号作为命令的参数传递,则需要转义方括号或像这样引用参数:

pip install 'requests[security]'

如果你想永久禁用命令的通配符pip,可以将其添加到你的中~/.zshrc

alias pip='noglob pip'