Skip to content

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

Merged
jnothman merged 1 commit into
scikit-learn:masterfrom
taion:extras_require-pip
Aug 31, 2016
Merged

jnothman merged 1 commit into
scikit-learn:masterfrom
taion:extras_require-pip

Conversation

@taion

@taion taion commented Jul 14, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

taion commented Jul 16, 2016

Copy link
Copy Markdown
Contributor Author

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

taion commented Jul 16, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

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

@taion

taion commented Jul 19, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

@jnothman wdyt?

@taion

taion commented Aug 20, 2016

Copy link
Copy Markdown
Contributor Author

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

@jnothman

Copy link
Copy Markdown
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

taion commented Aug 21, 2016

Copy link
Copy Markdown
Contributor Author

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

@jnothman

Copy link
Copy Markdown
Member

Or [alldeps]?

@taion

taion commented Aug 22, 2016

Copy link
Copy Markdown
Contributor Author

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

@taion

taion commented Aug 22, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

still LGTM.

Comment thread doc/install.rst Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 [email protected] 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
Copy Markdown
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
Copy Markdown
Member

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

@jnothman

Copy link
Copy Markdown
Member

LGTM

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

Copy link
Copy Markdown
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