merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
415 stars 142 forks source link

[BUG] anvi-get metabolic-model-file ImportError: Numba needs NumPy 1.25 or less #2156

Closed Mild-High closed 8 months ago

Mild-High commented 8 months ago

Short description of the problem

When running anvi-get-metabolic-model-file "ImportError: Numba needs NumPy 1.25 or less" occurs.

anvi'o version

Anvi'o .......................................: marie (v8-dev) Python .......................................: 3.10.12

Profile database .............................: 38 Contigs database .............................: 22 Pan database .................................: 17 Genome data storage ..........................: 7 Auxiliary data storage .......................: 2 Structure database ...........................: 2 Metabolic modules database ...................: 4 tRNA-seq database ............................: 2

System info

Running through wsl on Windows

Files / commands to reproduce the issue

$ anvi-get-metabolic-model-file -c control/control-contigs.db -o control_fba.json

Traceback (most recent call last): File "/home/chrysanthemyl/github/anvio/bin/anvi-get-metabolic-model-file", line 10, in import anvio.biochemistry.reactionnetwork as reactionnetwork File "/home/chrysanthemyl/github/anvio/anvio/biochemistry/reactionnetwork.py", line 26, in import anvio.utils as utils File "/home/chrysanthemyl/github/anvio/anvio/utils.py", line 31, in from numba import jit File "/home/chrysanthemyl/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numba/init.py", line 55, in _ensure_critical_deps() File "/home/chrysanthemyl/miniconda3/envs/anvio-dev/lib/python3.10/site-packages/numba/init.py", line 42, in _ensure_critical_deps raise ImportError("Numba needs NumPy 1.25 or less") ImportError: Numba needs NumPy 1.25 or less

Workaround

pip install --force-reinstall numpy==1.25 (installed numpy-1.23.5 in my case)

meren commented 8 months ago

@Mild-High, that workaround should not have been necessary, since the anvi'o installed on my computer following the installation instructions word-by-word already has numpy 1.23.5. This is because the requirements.txt has the line numpy<=1.24 as a dependency. I'm not sure how you installed, but you shouldn't ever run into this. I'm glad it is resolved though!

Mild-High commented 8 months ago

@meren Sounds good! I installed via the instructions as well, wonder if numpy was changed on my system by some other program or installation or something. Thanks!

Edit: something is going on with my system, my numpy was changed back to 1.26.1. I see a lot of this workaround in my future haha