zsh no matches found requestssecurity
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
zsh: no matches found: requests[security] is a shell-expansion problem, not a pip or Python packaging problem. In zsh, square brackets are part of glob syntax, so an extras spec such as requests[security] is interpreted before pip ever sees it. The fix is to pass the package string literally by quoting or escaping it.
Why zsh Rejects the Command
zsh expands wildcards before it runs the command. That means this:
is not treated as plain text. zsh reads [security] as a pattern character class. If no filenames in the current directory match that pattern, zsh stops with:
The important detail is that pip was never the failing component.
Correct Ways To Install Package Extras
You need the shell to leave the argument unchanged.
Safest form:
Escaped form:
Both work. Quoting is usually easier to read and copy into docs and scripts.
Why python -m pip Is Better Than Plain pip
This problem is about zsh, but it often appears alongside environment confusion. Using python -m pip makes the target interpreter explicit.
That matters on machines with:
- System Python and Homebrew Python.
- Virtual environments.
- '
pippointing to a different interpreter than the one running your app.'
So the best command is usually:
or, in a virtual environment:
Temporary zsh-Specific Workarounds
zsh also has a noglob prefix that disables globbing for one command.
This is useful interactively, but it is not the best pattern for shared scripts. Quoting the package string is more explicit and portable across shells.
Some users also change zsh options such as nomatch, but that is a shell-wide behavior change and can create hard-to-debug inconsistencies between machines.
Requirements Files and CI
You do not need shell escaping inside requirements.txt because the shell is not parsing those lines.
Example:
Install it with:
This is often the cleanest way to avoid shell quoting issues in CI pipelines and onboarding docs.
In CI, also prefer explicit version logging:
That makes interpreter mismatch easier to diagnose.
The Same Issue Appears With Other Extras
This is not specific to requests. The same problem appears with any package extras syntax in zsh, for example:
- '
uvicorn[standard]' - '
httpx[socks]' - '
celery[redis]'
If square brackets are in the package spec, quote the argument.
Documentation and Team Hygiene
If you write README or setup instructions for a team, quote extras in every example. Otherwise macOS users with default zsh shells will hit this immediately.
Good docs:
Bad docs:
That single omission creates repeated onboarding friction.
Common Pitfalls
- Blaming
pipwhen zsh prevented the command from executing. Fix by recognizing this as a shell-parsing error. - Using unquoted extras syntax in zsh. Fix by quoting or escaping the package spec.
- Using plain
piptied to the wrong interpreter. Fix by usingpython -m pip. - Relying on shell-option tweaks instead of explicit quoting. Fix by keeping commands portable and literal.
- Forgetting to quote extras in documentation and CI snippets. Fix by standardizing quoted examples everywhere.
Summary
- '
zsh: no matches foundforrequests[security]is caused by shell globbing.' - Quote or escape the extras spec so
pipreceives the literal string. - Prefer
python -m pipto avoid interpreter mismatch. - Requirements files avoid this shell-parsing issue entirely.
- The same quoting rule applies to any package extras syntax used in zsh.
Related reading
- -bash aws command not found
- -bash bin/kafka-topics.sh No such file or directory installed via ambari
- -bash kafka-server-start.sh command not found
- -didSelectRowAtIndexPath not being called
- -Dlogback.configurationFilelogback.xml ignored when running Spring-Boot
- ''0000-00-00 000000'' can not be represented as java.sql.Timestamp error
- 0/1 nodes are available 1 nodes didn't have free ports for the requested pod ports when start the promethus exporter
- 100% cpu usage by all kafka brokers
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.