Mu: pip install -e .[dev] error in mac zsh

Created on 4 Jun 2019  路  13Comments  路  Source: mu-editor/mu

When running pip install -e .[dev] in Z shell you get the following error:

$ pip install -e .[dev]
zsh: no matches found: .[dev]

This is because (source) :

zsh uses square brackets for globbing / pattern matching.

So we need to run this instead:

pip install -e .'[dev]'

Normally I would have consider this a well-known or easy to find difference in a custom shell, that most developers that have installed it should be able to solve on their own.
However with yesterday's announcement that macOS Catalina will use zsh by default (https://support.apple.com/en-ca/HT208050) we should probably add a note to the dev docs.

macOS

Most helpful comment

Good catch @carlosperate.

I'm just wondering how / whether one could address "all possible CLI shell" nuances such as the one you point out. Of course we want to remove all friction from beginners, and having the documentation say pip install -e ".[dev]" will be better that pip install -e .[dev], in that regard.

I went looking at how other projects document it:

Interestingly these are using single-quotes ' instead of double-quotes ". Being very familiar with UNIX like systems, I'd prefer to go with single-quotes too (easier to type on most keyboard layouts and no variable interpolation at play)...

Then I tested Windows, and even though PowerShell likes the single-quotes approach, cmd.exe fails miserably; tested the suggested double-quotes approach and it worked in both Windows CLI shells. So I guess that's it: pip install -e ".[dev]"

+1

All 13 comments

(Sigh) Just when we think we've got a consistent, universal way of installing a dev environment...

FWIW it works in Windows if you use double quotes:

pip install -e ."[dev]"

Does that fly in macOS as well?

Yep, testing zsh 5.3 and bash 3.2 in macOS Mojave, pip install -e ."[dev]" works, and pip install -e ".[dev]" works too.

Ok; so if someone can confirm from the Linux / Bash perspective then I think we can tweak the docs. @ntoll ?

I have just tested pip install -e ".[dev]" with csh and bash. It worked with both.

Thanks Barry!
So it looks like pip install -e ".[dev]" works universally.

pip install -e .\[dev\] works as well
"[", "]" and "!" are special characters in Zsh, therefore we need to escape them

Hah... just got in from a bunch of meetings to find this thread. Well done everyone for finding, fixing and testing..! :+1:

I have to admit having a big sigh at the same point in the conversation as @tjguk.

@darksunium good to know..!

Good catch @carlosperate.

I'm just wondering how / whether one could address "all possible CLI shell" nuances such as the one you point out. Of course we want to remove all friction from beginners, and having the documentation say pip install -e ".[dev]" will be better that pip install -e .[dev], in that regard.

I went looking at how other projects document it:

Interestingly these are using single-quotes ' instead of double-quotes ". Being very familiar with UNIX like systems, I'd prefer to go with single-quotes too (easier to type on most keyboard layouts and no variable interpolation at play)...

Then I tested Windows, and even though PowerShell likes the single-quotes approach, cmd.exe fails miserably; tested the suggested double-quotes approach and it worked in both Windows CLI shells. So I guess that's it: pip install -e ".[dev]"

+1

@tmontes That's because double quotes are for string formatting, like back ticks (`) in JavaScript or f-Strings in Python

export x=10
echo "${x}"  # Output: 10
echo '${x}'  # Output: ${x}

Using single quotes, it escapes special chars, but using double quotes, it doesn't :D

I suppose that given the fact that #878 has been merged, this issue can be closed? :)

Yes, indeed. Thanks everybody for looking into all the multiple options!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hwiguna picture hwiguna  路  8Comments

carlosperate picture carlosperate  路  7Comments

probonopd picture probonopd  路  5Comments

ron333 picture ron333  路  3Comments

ladyada picture ladyada  路  4Comments