Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
410 views
in Technique[技术] by (71.8m points)

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

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

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.

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: no matches found: requests[security]

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

I am running this on a Debian Server...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

zsh uses square brackets for globbing / pattern matching.

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]'

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'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...