0

I wanted to try and understand why does this (for example) fail:

pip install python-jose[cryptography]

which is the way the docs tells you to install it - https://pypi.org/project/python-jose/

The error I get is:

zsh: no matches found: python-jose[cryptography]

while this works:

pip install 'python-jose[cryptography]'

The same happens with other packages, and only by luck I stumbled across the docs for mypy-boto3 which showed the quotes as the way to install it: https://pypi.org/project/mypy-boto3/

I was about to try and create a pull request with a fix to the python-jose docs, but then I looked at the docs for installing packages and saw this: https://pip.pypa.io/en/stable/reference/pip_install/

Install a package with setuptools extras.

$ pip install SomePackage[PDF] 
$ pip install git+https://git.repo/some_pkg.git#egg=SomePackage[PDF] 
$ pip install .[PDF]  # project in current directory 
$ pip install SomePackage[PDF]==3.0 $ pip install SomePackage[PDF,EPUB]  # multiple extras

Nothing tells you to use quotes...except for mypy-boto3, god bless them. Where does the problem lie? (surely with my machine...)

My env is:

Mac OS
Python 3.7.6
pip 20.1

Same thing happens with latest pipenv

halfer
  • 19,824
  • 17
  • 99
  • 186
Roy Ca
  • 473
  • 1
  • 3
  • 13
  • 2
    Perhaps this is specific to zsh? The command works without quotes in bash, for example. – snakecharmerb May 10 '20 at 18:54
  • Perhaps: The hyphen makes the difference and you need to enclose the relevant text together in a set of quotation marks. This is like specifying a path where you have empty spaces. – CypherX May 10 '20 at 18:56
  • 1
    @snakecharmerb yeah that was it, turns out "zsh uses square brackets for globbing / pattern matching." which means you need to enclose it with quotes. from here: https://stackoverflow.com/questions/30539798/zsh-no-matches-found-requestssecurity. I couldn't find it until I looked for 'zsh' also – Roy Ca May 10 '20 at 18:58
  • @snakecharmerb if you want to write something i'll mark it as an answer – Roy Ca May 10 '20 at 19:01
  • 3
    Better to mark this as a dupe of the Q you linked to, if you agree? – snakecharmerb May 10 '20 at 19:03
  • @snakecharmerb right, thanks. flagged as dup. – Roy Ca May 10 '20 at 19:09

0 Answers0