Skip to content

[MRG] better message for pillow import error #14027

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

Merged
merged 3 commits into from
Jun 7, 2019

Conversation

NicolasHug
Copy link
Member

@glemaitre
Copy link
Member

While I agree that it is better to give such a message, I think that we should be careful with the directive. Basically, we could install with brew, debian, pip, conda, etc. We could be a bit less assertive and refer to the PIL documentation:

Refer to https://pillow.readthedocs.io/en/stable/installation.html for installing PIL.

WDYT?

@glemaitre
Copy link
Member

By the way, the CI failure is a new one. Never saw it before.

@NicolasHug
Copy link
Member Author

We always use pip install ... in the contributing docs, I don't see why we should do otherwise here. The first thing the Pillow link recommends is also pip install ...

@adrinjalali
Copy link
Member

yeah I agree with @NicolasHug. We could otherwise refer to the installation docs of pytest, cython, etc.

This looks good to me, thanks!

@glemaitre
Copy link
Member

We always use pip install ... in the contributing docs, I don't see why we should do otherwise here.

Because people will have to read the documentation to understand what it implies to pip install pillow and it might not be what they want.

We might want to change our contribution guide, starting with an early note mentioning that we will use pip and that one might need to change slightly the install instruction of the dependencies if you want to use system or another package manager.

I think that @amueller did a similar comment on one of @thomasjpfan PR regarding the installation of pandas or matplotlib (I could not find which PR thought)

The first thing the Pillow link recommends is also pip install ...

Yes but it also mentioned brew or apt-get. Then is up to the user to make the right choice.

@NicolasHug
Copy link
Member Author

I don't mind. Feel free to push your changes

@rth
Copy link
Member

rth commented Jun 5, 2019

We always use pip install ... in the contributing docs [...] We could otherwise refer to the installation docs of pytest, cython, etc.

We do have https://scikit-learn.org/stable/developers/advanced_installation.html though. The problem is that indicating pip install something in an error message can be bad advice if the user is using the system python, gets a permission error, starts to run sudo pip install .. and messes up his system all by following instructions without thinking. So in this case letting them search for a solution is not so bad IMO. (Though the error message do need improvement).

For contributing instructions, I think pip install can be fine, as potential contributors are a small fraction of users that should be more aware of these things (or at least figuring these things out it is part of the "contribution experience").

@adrinjalali
Copy link
Member

adrinjalali commented Jun 5, 2019 via email

@amueller
Copy link
Member

amueller commented Jun 5, 2019

why would we need pil? Shouldn't we use imageio?

@rth
Copy link
Member

rth commented Jun 5, 2019

Shouldn't we use imageio?

imageio depends on pillow so that would be 1 extra dependency in addition to pillow.

@amueller
Copy link
Member

amueller commented Jun 5, 2019

really? but why? ok, just ignore me...

Copy link
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adrinjalali adrinjalali merged commit 2b571c0 into scikit-learn:master Jun 7, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
* better import error message for pillow

* pillow -> Pillow

* link to pillow page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants