8

I am following the example to install unvicorn:

https://www.uvicorn.org/

by doing:

pip install uvicorn[standard]

But received the following error:

 % pip install uvicorn[standard]
zsh: no matches found: uvicorn[standard]

However this works:

 % pip install uvicorn

I am on MacPro with Python 3.7.

marlon
  • 6,029
  • 8
  • 42
  • 76
  • 2
    Seen [this](https://stackoverflow.com/q/30539798/1707353)? – Jeff Holt Aug 20 '21 at 00:32
  • 4
    Does this answer your question? [zsh: no matches found: requests\[security\]](https://stackoverflow.com/questions/30539798/zsh-no-matches-found-requestssecurity) – MatsLindh Aug 20 '21 at 09:01

3 Answers3

24

You need to use single quotes.

pip install 'uvicorn[standard]'
Gabriel G.
  • 464
  • 4
  • 14
11

zsh uses square brackets for globbing / pattern matching.

So, 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 'uvicorn[standard]'

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'
snowmanstark
  • 181
  • 7
0

For zsh you can configure it to just run the command without trying to do any glob expansion when there are no files to match:

unsetopt nomatch
sorin
  • 161,544
  • 178
  • 535
  • 806