Bergvca / string_grouper

Super Fast String Matching in Python
MIT License
364 stars 76 forks source link

Module compiled against API version 0x10 but this version of numpy is 0xf #91

Closed jpswagner closed 1 year ago

jpswagner commented 1 year ago

I'm getting this error while importing string_grouper: module compiled against API version 0x10 but this version of numpy is 0xf . i have already tried upgrading numpy, using diferent versions but nothing seems to work. I'm using google colab, Python 3.9.16 It was working fine for weeks and suddenly i just started to get this error.

%pip install string_grouper

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting string_grouper Downloading string_grouper-0.6.1-py3-none-any.whl (29 kB) Requirement already satisfied: scikit-learn in /usr/local/lib/python3.9/dist-packages (from string_grouper) (1.2.2) Collecting sparse-dot-topn-for-blocks>=0.3.1 Downloading sparse_dot_topn_for_blocks-0.3.1.post3.tar.gz (17 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: scipy in /usr/local/lib/python3.9/dist-packages (from string_grouper) (1.10.1) Collecting topn>=0.0.7 Downloading topn-0.0.7.tar.gz (14 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: pandas>=0.25.3 in /usr/local/lib/python3.9/dist-packages (from string_grouper) (1.5.3) Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from string_grouper) (1.22.4) Requirement already satisfied: python-dateutil>=2.8.1 in /usr/local/lib/python3.9/dist-packages (from pandas>=0.25.3->string_grouper) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.9/dist-packages (from pandas>=0.25.3->string_grouper) (2022.7.1) Requirement already satisfied: cython>=0.29.15 in /usr/local/lib/python3.9/dist-packages (from sparse-dot-topn-for-blocks>=0.3.1->string_grouper) (0.29.34) Requirement already satisfied: setuptools>=42 in /usr/local/lib/python3.9/dist-packages (from sparse-dot-topn-for-blocks>=0.3.1->string_grouper) (67.6.1) Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.9/dist-packages (from scikit-learn->string_grouper) (1.2.0) Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.9/dist-packages (from scikit-learn->string_grouper) (3.1.0) Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.9/dist-packages (from python-dateutil>=2.8.1->pandas>=0.25.3->string_grouper) (1.16.0) Building wheels for collected packages: sparse-dot-topn-for-blocks, topn Building wheel for sparse-dot-topn-for-blocks (pyproject.toml) ... done Created wheel for sparse-dot-topn-for-blocks: filename=sparse_dot_topn_for_blocks-0.3.1.post3-cp39-cp39-linux_x86_64.whl size=2612457 sha256=cd690302c1556d8b8dbeaa8fce24a7e7e55afa00ec2b97753d167d365be9bd51 Stored in directory: /root/.cache/pip/wheels/07/72/84/5fda8e7d95a9c25f53ff4688454ebac51f9b1615bff3713838 Building wheel for topn (setup.py) ... done Created wheel for topn: filename=topn-0.0.7-cp39-cp39-linux_x86_64.whl size=1689159 sha256=705e187767be00d5afa62a01deb002ed4ffb7a8f64e7ca1a674f6a77c6002938 Stored in directory: /root/.cache/pip/wheels/d5/ee/c3/8e46e6555234ae4fb477befda374a35dd19388c2d9a290407b Successfully built sparse-dot-topn-for-blocks topn Installing collected packages: topn, sparse-dot-topn-for-blocks, string_grouper Successfully installed sparse-dot-topn-for-blocks-0.3.1.post3 string_grouper-0.6.1 topn-0.0.7

import pandas as pd from string_grouper import match_strings, match_most_similar, \ group_similar_strings, compute_pairwise_similarities, \ StringGrouper


RuntimeError Traceback (most recent call last) init.pxd in numpy.import_array()

RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last) in <cell line: 2>() 1 import pandas as pd ----> 2 from string_grouper import match_strings, match_most_similar, \ 3 group_similar_strings, compute_pairwise_similarities, \ 4 StringGrouper

4 frames /usr/local/lib/python3.9/dist-packages/sparse_dot_topn_for_blocks/sparse_dot_topn.pyx in init sparse_dot_topn_for_blocks.sparse_dot_topn()

init.pxd in numpy.import_array()

ImportError: numpy.core.multiarray failed to import


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

jpswagner commented 1 year ago

!pip install string_grouper --no-build-isolation

Apparently fixed the problem.