theislab / scvelo

RNA Velocity generalized through dynamical modeling
https://scvelo.org
BSD 3-Clause "New" or "Revised" License
412 stars 102 forks source link

Import error with `numpy>=2.0` #1251

Closed WeilerP closed 3 months ago

WeilerP commented 3 months ago

numpy>=2.0 does not include numpy.core._exceptions anymore, causing import error for scvelo.

# paste your code here, if applicable
import scvelo as scv
Error output ```pytb ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 8 5 import mplscience 6 import seaborn as sns ----> 8 import scvelo as scv 10 from constants import FIG_DIR File ~/code/scvelo/scvelo/__init__.py:6 3 from scanpy import read, read_loom 5 from scvelo import datasets, logging ----> 6 from scvelo import plotting as pl 7 from scvelo import preprocessing as pp 8 from scvelo import settings File ~/code/scvelo/scvelo/plotting/__init__.py:3 1 from scanpy.plotting import paga_compare, rank_genes_groups ----> 3 from .gridspec import gridspec 4 from .heatmap import heatmap 5 from .paga import paga File ~/code/scvelo/scvelo/plotting/gridspec.py:6 3 import matplotlib.pyplot as pl 5 # todo: auto-complete and docs wrapper ----> 6 from .scatter import scatter 7 from .utils import get_figure_params, hist 8 from .velocity_embedding import velocity_embedding File ~/code/scvelo/scvelo/plotting/scatter.py:16 14 from scvelo.preprocessing.neighbors import get_connectivities 15 from .docs import doc_params, doc_scatter ---> 16 from .utils import ( 17 default_basis, 18 default_color, 19 default_color_map, 20 default_legend_loc, 21 default_size, 22 default_xkey, 23 default_ykey, 24 get_ax, 25 get_components, 26 get_figure_params, 27 get_kwargs, 28 get_obs_vector, 29 get_value_counts, 30 gets_vals_from_color_gradients, 31 groups_to_bool, 32 interpret_colorkey, 33 is_categorical, 34 is_int, 35 is_list, 36 is_list_of_int, 37 is_list_of_list, 38 is_list_of_str, 39 make_dense, 40 plot_density, 41 plot_linfit, 42 plot_outline, 43 plot_polyfit, 44 plot_rug, 45 plot_velocity_fits, 46 rgb_custom_colormap, 47 savefig_or_show, 48 set_colorbar, 49 set_colors_for_categorical_obs, 50 set_label, 51 set_legend, 52 set_margin, 53 set_title, 54 to_list, 55 to_val, 56 to_valid_bases_list, 57 update_axes, 58 ) 61 @doc_params(scatter=doc_scatter) 62 def scatter( 63 adata=None, (...) 123 **kwargs, 124 ): 125 \"\"\"Scatter plot along observations or variables axes. 126 127 Arguments: (...) 139 If `show==False` a `matplotlib.Axis` 140 \"\"\" File ~/code/scvelo/scvelo/plotting/utils.py:8 6 import numpy as np 7 import pandas as pd ----> 8 from numpy.core._exceptions import UFuncTypeError 9 from pandas import Index 10 from scipy import stats ModuleNotFoundError: No module named 'numpy.core._exceptions'" ```
Versions ```pytb numpy>=2.0 ```