zsh: no matches found: uvicorn[standard]

Viewed 2580

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.

3 Answers

You need to use single quotes.

pip install 'uvicorn[standard]'

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'

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
Related