Error: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject - numpy

I am trying to run tombo v 1.5.1 and it needs numpy. I have installed numpy 1.24.1 but when I am running tombo, it is giving following error:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
Please help!!!
Installed numpy v 1.24.1
pip show numpy
Name: numpy
Version: 1.24.1
When I am running tombo it is giving following error:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
I uninstalled the previously installed numpy and reinstall lower verion with pip install numpy==1.20.3. Then it is giving me following error:
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
Note: I am using HPC system to install it.

Related

numpy-python (error failed to build wheels for numpy.)

I tried to make a program for face_recoginition and I face an import error
error: NumPy.core.multiarray failed to import.
to resolve (after google) I tried to reinstall NumPy using the command pip install numpy. I am getting an error failed to build wheels for numpy.
And I am not able to resolve it.

numpy typing works locally but not in circleci

I have numpy 1.22.4 installed locally and I changed the output of the expected methods from
def _predict(self, X: pd.DataFrame) -> np.array:
to
def _predict(self, X: pd.DataFrame) -> np.typing.ndarray:
When I execute locally mypy feature_engine the tests pass. But when committing the code to the repo, and the tests run in circle ci, they do not pass, because of the following error:
AttributeError: module 'numpy' has no attribute 'typing'
When I check the circleci environment, it seems to be working with numpy 1.22.4 as well:
Any idea why this could be happening?
For reference, this is the PR in question. These are the versions I have locally:
Python version: 3.10.3
Numpy version: 1.22.4
Pandas version: 1.4.2
Scikit-learn version: 1.1.1
Scipy version: 1.8.1
Statsmodels version: 0.13.2
Mypy version: 0.961
And the error thrown locally when I do not update from np.array to np.typing.ndarray can be seen here:
I found that I have to do something like: import numpy.typing as npt
in addition to my standard numpy import. I can then use the npt alias for all my type hints. Before I made that change I would get the ImportError whenever I tried to run my code.

I am running into an error while importing Spacy

When I try to import spacy in python 3.9, I get the following error:
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
Not really sure what's going on here. I have installed the package using pip, and updated my numpy as well. I am running my python file in TensorFlow env.
Any solutions?

Failed to install Numpy 1.20.2 with Poetry on Python 3.9

When I try to install Numpy 1.20.2 module with Python Poetry 1.1.4 package manager (poetry add numpy) in a Python 3.9.0 virtual environment, I get:
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
I read a few threads like this one, but since then it seems the latest Numpy versions are supposed to be able to be built with 3.9 (see this official Numpy release doc, and this answer).
Did I miss something?
EDIT: using pip 21.0.1 (latest)

symbol lookup error after updating conda 'undefined symbol: cairo_ft_font_options_substitute'

Last week I updated conda to version 3.11.0, after that I found either %pylab or plt.plot would encounter the symbol lookup error.
min#home:~$ ipython
In [1]: from matplotlib import pyplot as plt
In [2]: plt.plot([1, 2, 3, 4])
/home/min/anaconda/bin/python: symbol lookup error: /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined symbol: cairo_ft_font_options_substitute
min#home:~$ ipython
In [1]: %pylab
/home/min/anaconda/bin/python: symbol lookup error: /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0: undefined symbol: cairo_ft_font_options_substitute
I've reinstalled Anaconda and everything turned to fine, but once I conda update conda and conda update anaconda, the error showed up again.
I'm not sure what's the difference between "conda update conda" and "conda update cairo", I tried the second but didn't fix it in my fedora 20 i686, even though some packages were updated. [1]
So, I kept looking and I found [2], just the tittle made me think in "conda install cairo", and now most of my older scripts which uses matplotlib work fine.
sources:
[1]https://groups.google.com/a/continuum.io/forum/#!msg/anaconda/R0RdG3HQONg/r_LM-Al6b1YJ
[2]add cairo package in the anaconda python distribution