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

Error installing skimage- #1506

Closed
gsanrey opened this issue May 11, 2015 · 31 comments · Fixed by #1526
Closed

Error installing skimage- #1506

gsanrey opened this issue May 11, 2015 · 31 comments · Fixed by #1526

Comments

@gsanrey
Copy link

gsanrey commented May 11, 2015

Hi!
I've install skimage on a MacOs 10.10, like it's said in the documentation:
pip install -U scikit-image
and it say that need scipy to work, I had to install it to work.

@JDWarner
Copy link
Contributor

That is correct and the intended behavior. Required dependencies must be installed first, then scikit-image... at least when one uses pip.

pip itself is not a package manager. If you want that, a distribution like Anaconda or Canopy will "just work" by grabbing all necessary dependencies and then what you asked for.

@matthew-brett
Copy link
Contributor

Well - I think pip is a package manager - and if you install scikit-image, pip will also install:

Installing collected packages: scikit-image, networkx, matplotlib, pillow, six, decorator, nose, pytz, numpy, python-dateutil, mock, pyparsing

It's just that scipy is not among the declared dependencies for the install. Should it be?

@JDWarner
Copy link
Contributor

Looking a little further, scipy >= 0.9 is declared in requirements.txt so it should be brought along.

@JDWarner JDWarner reopened this May 11, 2015
@matthew-brett
Copy link
Contributor

I can't remember the exact source of the discussion, but I think it was deliberate that the requirements.txt requirements were different from the default pip / source install requirements.

@stefanv
Copy link
Member

stefanv commented May 11, 2015

Here is the reason for it:

# do not attempt to install numpy and scipy until they have eggs available
INSTALL_REQUIRES = [r for r in INSTALL_REQUIRES
                                     if not r.startswith(('scipy', 'numpy'))]

@matthew-brett
Copy link
Contributor

Hum - well - they do have 'eggs' available for OSX, but not for Windows or Linux. So.... ?

@stefanv
Copy link
Member

stefanv commented May 11, 2015

/cc @blink1073

@blink1073
Copy link
Member

We could special case darwin and leave it as-is on other platforms until
eggs are available.

On Mon, May 11, 2015 at 3:25 PM, Stefan van der Walt <
notifications@github.com> wrote:

/cc @blink1073 https://github.com/blink1073


Reply to this email directly or view it on GitHub
#1506 (comment)
.

@matthew-brett
Copy link
Contributor

Just to be clear - we mean 'wheels' right? I think eggs have definitely gone off.

@stefanv
Copy link
Member

stefanv commented May 11, 2015 via email

@matthew-brett
Copy link
Contributor

a) It will upgrade unnecessarily if someone upgrades scikit-image;
b) Scipy does take a long time and a fortran compiler - so it's pretty error prone for Linux, out of the question on Windows. For OSX, there should always be a wheel.

@stefanv
Copy link
Member

stefanv commented May 11, 2015

I thought the upgrade happens only when you specified a version.
Or does it always upgrade? That's pretty lousy.

@matthew-brett
Copy link
Contributor

@blink1073
Copy link
Member

Yes, I meant to say wheels, and yes, the behavior of pip install -U is quite lousy.

@arve0
Copy link
Contributor

arve0 commented May 22, 2015

I'm pretty sure this problem will go away (updating numpy, scipy, etc) if one does not define version (e.g. >=1.6.1) in setup.py. The dependency will be met if scipy is installed and only scipy is required. This has been discussed several times, but declined as one did not want to define dependencies in two places (or write a requirements.txt parser - which I think is silly for 7 requirements).

My take is that duplicating 7 requirements is worth it, and be rid of this installation trouble.

To be clear, the proposal is replacing

INSTALL_REQUIRES = [r for r in INSTALL_REQUIRES
                                     if not r.startswith(('scipy', 'numpy'))]

with

INSTALL_REQUIRES = [
    'cython',
    'matplotlib',
    'numpy',
    'scipy',
    'six',
    'networkx',
    'pillow' ]

@blink1073
Copy link
Member

From the pip documentation:

https://pip.pypa.io/en/latest/reference/pip_install.html#cmdoption-U

"Upgrade all specified packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied."

@blink1073
Copy link
Member

@arve0, even if we do not specify the version, we will still have this mess.

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

@blink1073 Sorry, I'm not following you. How will pip install scikit-image (without -U) be a mess, when all dependencies are declared?

This implies that the user either will get compiled wheels for his operating system (true for all dependencies on Mac and windows I believe), or has a system with compiler (should be added to the docs how the most popular, read Ubuntu, get that installed).

Are my assumptions wrong, or what have I missed?

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

For people wanting to upgrade, that will be pip install --upgrade --no-deps scikit-image, but the original poster was having trouble installing, not upgrading.

@blink1073
Copy link
Member

But when we add a new dependency (like dask), that would not work. 


Sent from Mailbox

On Sat, May 23, 2015 at 2:18 AM, Arve Seljebu notifications@github.com
wrote:

For people wanting to upgrade, that will be pip install --upgrade --no-deps scikit-image, but the original poster was having trouble installing, not upgrading.

Reply to this email directly or view it on GitHub:
#1506 (comment)

@blink1073
Copy link
Member

We could recommend pip uninstall scikit-image; pip install scikit-image


Sent from Mailbox

On Sat, May 23, 2015 at 2:18 AM, Arve Seljebu notifications@github.com
wrote:

For people wanting to upgrade, that will be pip install --upgrade --no-deps scikit-image, but the original poster was having trouble installing, not upgrading.

Reply to this email directly or view it on GitHub:
#1506 (comment)

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

or pip install --upgrade --no-deps scikit-image; pip install scikit-image (from the pip manual).

@blink1073
Copy link
Member

So that should work today without any changes to our setup.py, no?

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

All dependencies will have to be added (scipy and numpy), but versions should be stripped to avoid upgrading system-installed packages like scipy, matplotlib, etc.

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

In other words; dependencies will be either soft dependencies or hard dependencies.

  • Hard dependencies will require a specific version installed (this should in a perfect world only consist of python-only packages)
  • Soft dependencies will only require the package (and should not force upgrades)

E.g.

  • six is a hard dependency (we need above 1.3)
  • numpy is a soft dependency

Might add; there is nothing wrong with having (sane) hard dependencies in requirements.txt for developers. A developer should definitely have reasonable updated numpy/scipy/etc.

@blink1073
Copy link
Member

@Arve, the listed versions are hard dependencies in that we rely on functions or an API provided by those versions or the version is the minimum we can test against. 


Sent from Mailbox

On Sat, May 23, 2015 at 7:49 AM, Arve Seljebu notifications@github.com
wrote:

In other words; dependencies will be either soft dependencies or hard dependencies.

  • Hard dependencies will require a specific version installed (this should in a perfect world only consist of python-only packages)
  • Soft dependencies will only require the package (and should not force upgrades)
    E.g.
  • six is a hard dependency (we need above 1.3)
  • numpy is a soft dependency
    Might add; there is nothing wrong with having (sane) hard dependencies in requirements.txt for developers. A developer should definitely have reasonable updated numpy/scipy/etc.

    Reply to this email directly or view it on GitHub:
    Error installing skimage- #1506 (comment)

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

Well, then one should just remove

INSTALL_REQUIRES = [r for r in INSTALL_REQUIRES
                                     if not r.startswith(('scipy', 'numpy'))]

EDITED

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

Haha, sorry! I mean, remove it! 😆

@blink1073
Copy link
Member

Agreed, with the new suggested incantation we can certainly simplify setup.py, can to take a crack at the fix and the documentation update?


Sent from Mailbox

On Sat, May 23, 2015 at 8:06 AM, Arve Seljebu notifications@github.com
wrote:

Haha, sorry! I mean, remove it! 😆

Reply to this email directly or view it on GitHub:
#1506 (comment)

@arve0
Copy link
Contributor

arve0 commented May 23, 2015

I can take a look at it in the evening (GMT+1).

@blink1073
Copy link
Member

Thanks brother, keep keeping us honest. 😜

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 a pull request may close this issue.

6 participants