Incompatible scipy and numpy versions - numpy

I am trying to install a python package "ezLncPred" which requires a numpy version of 1.15 in my python3.8. While installing it tells that this version of numpy is not compatible with my SciPy version of 1.7.3. I have to upgrade it to numpy1.2 for it.
Any idea on how to resolve this issue ?

Related

tensorflow 1.15 installation numpy dependency

When I check the METADATA about the requires of the Numpy version for TensorFlow(tf).
tf 1.15.0 requries 1.16.0 <= numpy < 2.0, and actually installed numpy = 1.19.2
tf 1.15.5 requries 1.16.0 <= numpy < 1.19.0, and actually installed numpy = 1.18.5
However, If I upgrade tf from 1.15.0 to 1.15.5, I need to down the numpy from 1.19.2 to 1.18.5, which is not our intention.
Is there anyone know how to avoid this big gap for numpy if I want to upgrade tf to 1.15.5?
In other words, is the requirement for numpy version strictly conflict with version 1.19 when tf version is 1.15.5?
TF 1.15.0 requires "numpy<2.0,>=1.16.0" and installs numpy-1.19.5 while installing Tensorflow 1.15.0
TF 1.15.5 requires "numpy<1.19.0,>=1.16.0" and installs numpy-1.18.5 while installing Tensorflow 1.15.5
if you have TF 1.15.5 installed in your system and
you want to re-install TF 1.15.0 after uninstalling existing TF 1.15.5 , this TF version will be compatible with existing numpy-1.18.5 as it needs "numpy<2.0,>=1.16.0"
and the same way if you have TF 1.15.0 installed in your system and
you want to re-install TF 1.15.5 after uninstalling TF 1.15.0, this TF version will downgrade the existing numpy-1.19.5 to numpy-1.18.5 as TF 1.15.5 supports "numpy<1.19.0,>=1.16.0"
To answer your question -
TF 1.15.5 requires "numpy<1.19.0,>=1.16.0" and installs numpy-1.18.5
which is suitable for both the Tensrflow versions (1.15.5 or 1.15.0).
Also the compatible numpy version will automatically get installed when
you install any version of Tensorflow.

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)

install numpy 1.19 with MKL on ubuntu using anaconda?

When I do pip search numpy I got the following:
numpy (1.19.2) - NumPy is the fundamental package for array computing with Python.
INSTALLED: 1.19.1
LATEST: 1.19.2
....
intel-numpy (1.15.1) - NumPy optimized with Intel(R) MKL library
....
I'm on ubuntu 18.04 with pip 20.2.3 and anaconda 4.6.8. Is that the numpy w/ MKL version in pip is only up to that 1.15.1 version, and we have to build from source if we want 1.19.x version?
I tried using conda install numpy and it gave me openBLAS version for 1.19.2 and BLAS for 1.19.1

Pandas incompatible with numpy

I am using anaconda 3. When I try to import pandas I receive the following message:
ImportError: this version of pandas is incompatible with numpy < 1.15.4
your numpy version is 1.15.3.
Please upgrade numpy to >= 1.15.4 to use this pandas version
Printing numpy.__path__ gives me the following
['C:\Users\andrei\AppData\Roaming\Python\Python37\site-packages\numpy']
In conda list, my numpy version is 1.19.1. I checked the above directory to find that it has only numpy 1.15.3 inside and nothing else. Spyder is using this path instead of the anaconda's path to numpy for some arcane reason.
Looks like you have somehow installed several versions of NumPy. Try to remove them all by running several times conda remove numpy and pip uninstall numpy. If you have two versions, the corresponding uninstall command needs to be run twice. After these, install a fresh version of NumPy conda install numpy
You can verify if you still have a version of NumPy installed
conda list | grep numpy
pip list | grep numpy
Note that these commands show only one version number even if you have several copies installed.
You can use conda to upgrade to upgrade your numpy. Run this command in the terminal:
conda update numpy
You need to remove this directory
C:\Users\andrei\AppData\Roaming\Python\
to fix this problem. It seems at some point you used pip to install numpy and that's interfering with the packages installed by conda (which is reporting the right version, as you said).
Furthermore, please be aware that pip and conda packages are binary incompatible, so you should avoid as much as possible to mix them.

RuntimeError: module compiled against API version a but this version of numpy is 9 in ubuntu

I just installed theano, but
import numpy
print numpy.version
here is the output
Theano version 0.7.0.dev-30cc6380863b08a3a90ecbe083ddfb629a56161d
theano is installed in /home/sizhexi/theano/Theano/theano
NumPy version 1.8.2
NumPy is installed in /usr/lib/python2.7/dist-packages/numpy
Python version 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
nose version 1.3.1
RuntimeError: module compiled against API version a but this version of numpy is 9
terminate called after throwing an instance of 'std::runtime_error'
what(): numpy failed to initialize
Aborted (core dumped)
how to solve it?
Package management in python is sometimes tricky. To avoid these issues, I recommend using Anaconda which is a good python package and environment manager (download here, and 30 minutes guide).
Follow the official instructions to install Anaconda and chose the default values that will add Anaconda to your $PATH and make Anaconda your default python interpreter. Then open your terminal and use the following commands :
conda install pip six nose numpy scipy
pip install theano
Then try running your script using anaconda.