question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure with numpy 1.18.4

See original GitHub issue

We’re experiencing a bug with pyxDamerauLevenshtein 1.5.3 (any version above, and including, 1.5.2, really), when using it with numpy 1.18.4 (or any version between 1.18.4 and 1.20.0).

Here’s how to reproduce (using docker):

docker run --rm -ti python:3.7.6 bash
pip install numpy==1.18.4
pip install pyxdameraulevenshtein==1.5.3
python -c 'from pyxdameraulevenshtein import damerau_levenshtein_distance'

This will produce the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "__init__.pxd", line 242, in init pyxdameraulevenshtein
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

This was working fine until at least last Friday, but started failing without any change on our part.

I’m not sure if anything can be done (seems pretty hard to debug), but if someone has the same issue, upgrading numpy to 1.20.0+ or downgrading pyxDamerauLevenshtein to 1.5.1 works.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
patatepartiecommented, Feb 9, 2021

I’m not quite sure where the incompatibility comes from.

The weird thing is that it happened all of a sudden, without anything related (versions of python, numpy or pyxdameraulevenshtein) changing. The only thing I can think of is the system packages (build-essential, git, curl, unzip, in our debian-based docker image).

Part of me just wants to remove the NumPy dependency entirely

I can only speak for our case: numpy is required by many libraries we use, so having to upgrade it is a pretty big risk. Having one less library depending on numpy lower both the risk of having to upgrade numpy and the risk of breakages when we do have to upgrade numpy.

0reactions
patatepartiecommented, Feb 10, 2021

Thank you, @gfairchild 👍🏻 , especially for your responsiveness!

I tested with the reproduction steps above (without installing numpy first), and by running our unit test: everything seems ok.

We can close this issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failure with numpy 1.18.4 · Issue #28
We're experiencing a bug with pyxDamerauLevenshtein 1.5.3 (any version above, and including, 1.5.2, really), when using it with numpy 1.18.4 (or ...
Read more >
NumPy 1.18.4 Release Notes
This is the last planned release in the 1.18.x series. It reverts the bool("0") behavior introduced in 1.18.3 and fixes a bug in...
Read more >
Unexpected Error while install numpy 1.18.5
I am trying to install NumPy version 1.18.4 using having pip on windows 11 but it ends with the following error: Pyton version:...
Read more >
numpy 1.18.4
It provides: a powerful N-dimensional array object. sophisticated (broadcasting) functions. tools for integrating C/C++ and Fortran code.
Read more >
[Solution]-Unexpected Error while install numpy 1.18.5-numpy
I am trying to install NumPy version 1.18.4 using having pip on windows 11 but it ends with the following error: Pyton version:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found