zsh: no matches found

Leigh Johnson
Leigh Johnson

I've been using zsh and ohmyz.sh for years, but I still occasionally forget this shell interprets square brackets as a pattern on the command line. Two improvements on the default behavior.

I've been using zsh and ohmyz.sh for years, but I still occasionally forget this shell interprets square brackets as a pattern on the command line.

Here's an example:

$ which $SHELL
/usr/bin/zsh
$ pip install -e .[develop,plugins]
zsh: no matches found: [develop,plugins]

Instead of installing the develop and plugins variant of this Python package, zsh attempted to match this pattern. To account for this, I need to escape the square brackets:

$ pip install -e .\[develop,plugins\] 
Obtaining file:///home/leigh/projects/OctoPrint

If I need a more permanent fix, I can use an alias to set -o noglob (disable shell globbing) for a command is run by adding this to my .zshrc file:

alias pip='noglob pip'


Join the conversation.

Great! Check your inbox and click the link
Great! Next, complete checkout for full access to Bitsy.ai
Welcome back! You've successfully signed in
You've successfully subscribed to Bitsy.ai
Success! Your account is fully activated, you now have access to all content
Success! Your billing info has been updated
Your billing was not updated