python - zsh:未找到匹配项:请求 [安全]

标签 python pip python-requests zsh

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

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 安装请求[安全]

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

zsh: no matches found: requests[security]

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

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

最佳答案

zsh 使用 square brackets for globbing / pattern matching .

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

pip install 'requests[security]'

如果您想禁用 globbing对于 pip 命令永久,您可以通过将其添加到您的 ~/.zshrc 来做到这一 pip :

alias pip='noglob pip'

关于python - zsh:未找到匹配项:请求 [安全],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30539798/

相关文章:

python - Base64 对 AppEngine 上上传的数据进行二进制编码

Python:如何使用正则表达式提取日期

python - 使用 python 请求和 beautifulsoup4 响应时缺少 html

python - Elasticsearch全文自动完成

Python 请求 POST 返回不完整的内容

python - OpenCV的dilate与scipy、matlab不同

python - 在 list.extend 中删除这个不需要的副本

python - 安装包(Python PIL/Pillow)但我无法导入它

ubuntu - 使用 venv 在 WSL 中安装 Python 要求时出现问题

python - 如何为 python 3.5.1 安装 mysql-connector?