Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install -e .[dev] error in mac zsh #852

Closed
carlosperate opened this issue Jun 4, 2019 · 13 comments
Closed

pip install -e .[dev] error in mac zsh #852

carlosperate opened this issue Jun 4, 2019 · 13 comments

Comments

@carlosperate
Copy link
Member

carlosperate commented Jun 4, 2019

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.

@tjguk
Copy link
Collaborator

tjguk commented Jun 4, 2019

(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?

@carlosperate
Copy link
Member Author

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

@tjguk
Copy link
Collaborator

tjguk commented Jun 4, 2019

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

@ukBaz
Copy link

ukBaz commented Jun 4, 2019

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

@carlosperate
Copy link
Member Author

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

@DarkSuniuM
Copy link

DarkSuniuM commented Jun 4, 2019

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

@ntoll
Copy link
Member

ntoll commented Jun 4, 2019

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

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

@ntoll
Copy link
Member

ntoll commented Jun 4, 2019

@DarkSuniuM good to know..!

@tmontes
Copy link
Member

tmontes commented Jun 7, 2019

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

@DarkSuniuM
Copy link

DarkSuniuM commented Jun 9, 2019

@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

carlosperate added a commit that referenced this issue Jul 3, 2019
From issue #852, this is to ensure it works in the upcoming version
of macOS Catalina, and other operating systems/shells.
@carlosperate
Copy link
Member Author

PR raised: #878

@tmontes
Copy link
Member

tmontes commented Jul 4, 2019

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

@carlosperate
Copy link
Member Author

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

ksekimoto pushed a commit to ksekimoto/mu that referenced this issue Jul 16, 2021
From issue mu-editor#852, this is to ensure it works in the upcoming version
of macOS Catalina, and other operating systems/shells.
RodrigoVillatoro added a commit to RodrigoVillatoro/pytorch_geometric that referenced this issue Feb 3, 2022
Modified the command in point four (4) so that it works correctly in all operating systems. More details in this thread: mu-editor/mu#852.
rusty1s pushed a commit to pyg-team/pytorch_geometric that referenced this issue Feb 3, 2022
Modified the command in point four (4) so that it works correctly in all operating systems. More details in this thread: mu-editor/mu#852.
f-dangel added a commit to f-dangel/python-utilities that referenced this issue Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants