Skip to content

[MRG + 1] BLD: Add 'pip' extra for installing with pip #6990

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 1 commit into from
Aug 31, 2016
Merged

[MRG + 1] BLD: Add 'pip' extra for installing with pip #6990

merged 1 commit into from
Aug 31, 2016

Conversation

taion
Copy link
Contributor

@taion taion commented Jul 14, 2016

Reference Issue

Fixes #4164

What does this implement/fix? Explain your changes.

This allows advanced users who are using standard Python management tools to install scikit-learn[pip], which includes the appropriate numpy and scipy dependencies.

@amueller
Copy link
Member

LGTM if you tested it ;)

@amueller amueller changed the title [MRG] BLD: Add 'pip' extra for installing with pip [MRG + 1] BLD: Add 'pip' extra for installing with pip Jul 15, 2016
@taion
Copy link
Contributor Author

taion commented Jul 16, 2016

Yup. If I do pip install ~/path/to/scikit-learn[pip] in a clean virtualenv, using recent version of pip, I end up with numpy, scipy, and scikit-learn, as expected.

@taion
Copy link
Contributor Author

taion commented Jul 16, 2016

What do you want documentation-wise? I can update https://github.com/scikit-learn/scikit-learn/blob/master/doc/install.rst, but when I ran into this problem originally, I don't think I would have even bothered to look there – I'd have much more likely looked at the setup.py source or checked the package listing on PyPI.

@nelson-liu
Copy link
Contributor

can confirm that this works on my machine, i just tried it out. thanks for the fix

@taion
Copy link
Contributor Author

taion commented Jul 19, 2016

One more possible nit – this could be structured as e.g. scikit-learn[numpy,scipy] (i.e. two separate extras, one for each dep) instead of as scikit-learn[pip].

@amueller
Copy link
Member

@jnothman wdyt?

@taion
Copy link
Contributor Author

taion commented Aug 20, 2016

Following up here – this would let us clean up our install procedures a bit.

@jnothman
Copy link
Member

I like moving the dependency versions to the top of the file.

I think we are increasingly able to rely on pip, and this is a decent transition. Yes, needs documentation for it to be useful.

@taion
Copy link
Contributor Author

taion commented Aug 21, 2016

Does [pip] make sense, or should it be [numpy,scipy]?

@jnothman
Copy link
Member

Or [alldeps]?

@taion
Copy link
Contributor Author

taion commented Aug 22, 2016

[alldeps] sounds good to me. I'll update this PR in a bit.

@taion
Copy link
Contributor Author

taion commented Aug 22, 2016

Updated. I added a note to install.rst mentioning this, and recommending against using it unless the user knows what he or she is doing.

@amueller
Copy link
Member

still LGTM.

your operation system, it is recommended to use a third party distribution.
your operating system, we recommended using a third-party distribution.

If you must install scikit-learn with pip, you can install it as
Copy link
Member

Choose a reason for hiding this comment

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

"along with its dependencies"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll go with "and its dependencies". The target use case isn't typing pip install scikit-learn[alldeps] on the command line – it's instead having a single requirements.txt that lists everything.

Copy link
Member

Choose a reason for hiding this comment

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

Clarify that then?

On 23 August 2016 at 12:55, Jimmy Jia notifications@github.com wrote:

In doc/install.rst
#6990 (comment)
:

If you are using Linux, consider using your package manager to install
scikit-learn. It is usually the easiest way, but might not provide the newest
version.
If you haven't already installed numpy and scipy and can't install them via
-your operation system, it is recommended to use a third party distribution.
+your operating system, we recommended using a third-party distribution.
+
+If you must install scikit-learn with pip, you can install it as

I'll go with "and its dependencies". The target use case isn't typing pip
install scikit-learn[alldeps] on the command line – it's instead having a
single requirements.txt that lists everything.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/scikit-learn/scikit-learn/pull/6990/files/83d14b234d3be76737a15f12f8dc99696d0bf4d3#r75795830,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz64iSp68aVAfdWDAGSObo9_PV2MIzks5qimEtgaJpZM4JM0Pv
.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. This now reads:

If you must install scikit-learn and its dependencies with pip, you can install
it as scikit-learn[alldeps]. We strongly recommend against doing this
unless you are familiar with how to correctly build numpy and scipy. The most
common use case for this is in a requirements.txt file used as part of an
automated build process for a PaaS application or a Docker image. This option
is not intended for manual installation from the command line.

This allows advanced users who are using standard Python package
management tools to install scikit-learn[alldeps], which includes the
appropriate numpy and scipy dependencies.
@amueller
Copy link
Member

I think it would be good to have that for the release. @jnothman ?

@jnothman
Copy link
Member

LGTM

@jnothman jnothman merged commit 6297815 into scikit-learn:master Aug 31, 2016
@jnothman
Copy link
Member

thanks @taion

@taion taion deleted the extras_require-pip branch September 1, 2016 00:01
TomDLT pushed a commit to TomDLT/scikit-learn that referenced this pull request Oct 3, 2016
This allows advanced users who are using standard Python package
management tools to install scikit-learn[alldeps], which includes the
appropriate numpy and scipy dependencies.
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
This allows advanced users who are using standard Python package
management tools to install scikit-learn[alldeps], which includes the
appropriate numpy and scipy dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't setup.py install without numpy
4 participants