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

Version conflict of numpy requirement on 32bit architecture #1243

Closed
grzanka opened this issue Jan 1, 2018 · 6 comments
Closed

Version conflict of numpy requirement on 32bit architecture #1243

grzanka opened this issue Jan 1, 2018 · 6 comments

Comments

@grzanka
Copy link

grzanka commented Jan 1, 2018

I am trying install matplotlib package on 32bit linux with python 3.5 and pip 9.0.
Newest matplotlib version (2.1.1) doesn't have manylinux1 wheels, so source compilation takes place.
Unfortunately matplotlib (according to setup.py) is build against numpy RC (1.14) while requirements trigger later installation of stable numpy (1.13). Due to API incompatibility between these two numpy versions, matplotlib installation is broken.

To reproduce use following code:

→ docker run --rm -it i386/debian:stable linux32 bash
root@b2cf53793176:/# apt-get update -qq
root@b2cf53793176:/# apt-get install python3-pip libfreetype6-dev pkg-config python3-dev gfortran libatlas-dev libatlas-base-dev subversion -y -qq 1>1.log 2>2.log 
root@b2cf53793176:/# pip3 install matplotlib -vvv 1>stdout.log 2>stderr.log
root@b2cf53793176:/# python3 -c "import matplotlib.artist as martist"
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/artist.py", line 16, in <module>
    from .path import Path
  File "/usr/local/lib/python3.5/dist-packages/matplotlib/path.py", line 25, in <module>
    from . import _path, rcParams
ImportError: numpy.core.multiarray failed to import
root@b2cf53793176:/# cat stdout.log | grep NPY_API_VERSION
    #define NPY_API_VERSION 0x0000000C

See more details here: matplotlib/matplotlib#10135 (comment)

This issue is already submitted on matplotlib github: matplotlib/matplotlib#10135 and discussed with @QuLogic there.

@benoit-pierre
Copy link
Member

Looks like a duplicate of #855: when fetching requirements, easy_install allow pre-releases per default, while pip disallow them unless --pre is used.

@grzanka
Copy link
Author

grzanka commented Jan 2, 2018

@benoit-pierre thank you for explaining the issue. I knew pip behavior, but the fact that easy_install behave differently surprised me.
Is there any way to to configure easy_install to require stable, non-prerelease packages (something that is compatible with default pip behavior) ? Ideally something that is not like putting the constraint on the version number.

@benoit-pierre
Copy link
Member

The code in pkg_resources explicitly allow pre-releases. Changing it will impact users of the API. I think it would make sense to only allow a pre-release if a requirement does ask for it, something along those lines:

 setuptools/package_index.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git i/setuptools/package_index.py w/setuptools/package_index.py
index ad743307..4f2a93bf 100755
--- i/setuptools/package_index.py
+++ w/setuptools/package_index.py
@@ -21,7 +21,7 @@ import setuptools
 from pkg_resources import (
     CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
     Environment, find_distributions, safe_name, safe_version,
-    to_filename, Requirement, DEVELOP_DIST, EGG_DIST,
+    to_filename, Requirement, DEVELOP_DIST, EGG_DIST, parse_version
 )
 from setuptools import ssl_support
 from distutils import log
@@ -620,6 +620,13 @@ class PackageIndex(Environment):
             # Find a matching distribution; may be called more than once
 
             for dist in env[req.key]:
+                if parse_version(dist.version).is_prerelease and not req.specifier.prereleases:
+                    if dist not in skipped:
+                        self.warn(
+                            "Skipping pre-release version: %s", dist,
+                        )
+                        skipped[dist] = 1
+                    continue
 
                 if dist.precedence == DEVELOP_DIST and not develop_ok:
                     if dist not in skipped:

This should match the behavior of pip when --pre is not used:

  • pip wheel --no-deps 'numpy>1.14.0rc1 fails (last stable release is 1.13.3 only)
  • but pip wheel --no-deps 'numpy>=1.14.0rc1' will fetch 1.14.0rc1

@benoit-pierre
Copy link
Member

And to answer your question: no, unfortunately I'm not aware of a way to configure easy_install to ignore pre-releases.

@jaraco
Copy link
Member

jaraco commented Jan 4, 2018

I wouldn't be opposed to easy_install only installing non-pre-release versions.

@pganssle pganssle added the Needs Triage Issues that need to be evaluated for severity and status. label Oct 19, 2018
@pganssle
Copy link
Member

Closing this in favor of #855.

@pganssle pganssle added duplicate enhancement and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 22, 2018
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

4 participants