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

NumPy is not supported a supported wheel on this platform #119

Open
cemlyn007 opened this issue Aug 3, 2023 · 6 comments
Open

NumPy is not supported a supported wheel on this platform #119

cemlyn007 opened this issue Aug 3, 2023 · 6 comments

Comments

@cemlyn007
Copy link

Hi first of all, awesome work!

I downloaded NumPy from PyPi for MacOS M2 but I am getting wheel not supported on this platform?

(venv) c.waters@192 medusa % pip install /Users/c.waters/Downloads/numpy-1.23.5-cp39-cp39-macosx_11_0_arm64.whl
Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
ERROR: numpy-1.23.5-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.
(venv) c.waters@192 medusa % which python
/Users/c.waters/Documents/Development/medusa/venv/bin/python
(venv) c.waters@192 medusa % python -V
Python 3.9.10
(venv) c.waters@192 medusa % python
Python 3.9.10 (heads/nogil:3162ce0144, Aug  2 2023, 12:19:47)
[nogil, Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Reason why I am trying to get this to work? I want to experiment with using this with some ML libraries and I cannot use NumPy 1.24.0 (which I could pip install) 😄

@cemlyn007
Copy link
Author

FYI, if I try:

pip install https://files.pythonhosted.org/packages/13/b1/0c22aa7ca1deda4915cdec9562f839546bb252eecf6ad596eaec0592bd35/numpy-1.23.1.tar.gz

I get a long error where I think the main important part is:

INFO: gcc: numpy/core/src/multiarray/scalarapi.c
numpy/core/src/multiarray/shape.c:108:22: error: no member named 'ob_refcnt' in 'struct _object'
            refcnt = PyArray_REFCOUNT(self);
                        ^~~~~~~~~~~~~~~~~~~~~~
numpy/core/include/numpy/ndarrayobject.h:102:53: note: expanded from macro 'PyArray_REFCOUNT'
#define PyArray_REFCOUNT(obj) (((PyObject *)(obj))->ob_refcnt)
                                    ~~~~~~~~~~~~~~~~~~~  ^
1 error generated.

@cemlyn007
Copy link
Author

FYI, this is why I am having issues:

(venv) c.waters@192 medusa % pip install ml-dtypes
Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
Collecting ml-dtypes
  Using cached ml_dtypes-0.2.0.tar.gz (698 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
      Ignoring numpy: markers 'python_version >= "3.11"' don't match your environment
      ERROR: Could not find a version that satisfies the requirement numpy~=1.21.2 (from versions: 1.19.3, 1.21.0, 1.22.3, 1.24.0)
      ERROR: No matching distribution found for numpy~=1.21.2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@colesbury
Copy link
Owner

Hi @cemlyn007, the NumPy wheels and source distributions from PyPI will not be compatible. The source distributions require patches that are not yet upstreamed.

It looks like ml-dtypes wants NumPy 1.21.2. You can probably get away with NumPy 1.21.0:

  1. pip install "numpy==1.21.0"
  2. pip install ml-dtypes

If that doesn't work, you can try installing ml-dtypes with --no-deps after you manually install the other dependencies.

Let me know if you run into problems with this approach.

@colesbury
Copy link
Owner

For context, here are the patches for NumPy 1.21.0: https://github.com/colesbury/numpy/commits/v1.21.0-nogil

@cemlyn007
Copy link
Author

Ah I am terribly sorry, I didn't realise you've created a fork of NumPy although that now makes more sense since the pip index url wasn't pointing to just PyPi!

@cemlyn007
Copy link
Author

cemlyn007 commented Aug 4, 2023

I tried using the install no dependencies flag but it is almost like NumPy was ignored.

(venv) c.waters@192 medusa % pip install "numpy==1.21"        
Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
Requirement already satisfied: numpy==1.21 in ./venv/lib/python3.9/site-packages (1.21.0)
(venv) c.waters@192 medusa % pip install "ml-dtypes" --no-deps
Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
Collecting ml-dtypes
  Using cached ml_dtypes-0.2.0.tar.gz (698 kB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      Looking in indexes: https://d1yxz45j0ypngg.cloudfront.net/, https://d1yxz45j0ypngg.cloudfront.net/, https://pypi.org/simple
      Ignoring numpy: markers 'python_version >= "3.11"' don't match your environment
      ERROR: Could not find a version that satisfies the requirement numpy~=1.21.2 (from versions: 1.19.3, 1.21.0, 1.22.3, 1.24.0)
      ERROR: No matching distribution found for numpy~=1.21.2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

(venv) c.waters@192 medusa % pip -V
pip 22.3.1

(venv) c.waters@192 medusa % pip list | grep numpy
numpy              1.21.0

Looking at pyproject.toml for ml-dtypes, the developers have it listed as a require here.

Either way maybe I am wasting your time because I think this package (ml-dtypes) is going to have a similar issue as #116 because it depends on PyBind?

Hopefully all of this will get ironed out one day, either way fantastic work mate!

(I don't normally make issues, but maybe this one is drifting away from any NumPy that is not 1.21.2, please feel free to close it if this you think the issue is not really relevant)

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

No branches or pull requests

2 participants