问题遇到的现象和发生背景
环境:python 3.9.7, windows11
问题相关代码,请勿粘贴截图
安装dtale步骤
conda create -n dtale python
conda activate dtale
pip install dtale
代码
import seaborn as sns
import dtale
df = sns.load_dataset('planets')
dtale.show(df, ignore_duplicate=True)
运行结果及报错内容
Traceback (most recent call last):
File "D:\pythonWorkspace\big_search_clawer\efficiency\efficiency2.py", line 11, in <module>
import dtale
File "D:\Anaconda\lib\site-packages\dtale\__init__.py", line 21, in <module>
from dtale.app import show, get_instance, instances, offline_chart # isort:skip
File "D:\Anaconda\lib\site-packages\dtale\app.py", line 50, in <module>
from dtale.views import DtaleData, head_endpoint, is_up, kill, startup
File "D:\Anaconda\lib\site-packages\dtale\views.py", line 36, in <module>
import xarray as xr
File "D:\Anaconda\lib\site-packages\xarray\__init__.py", line 1, in <module>
from . import testing, tutorial
File "D:\Anaconda\lib\site-packages\xarray\testing.py", line 9, in <module>
from xarray.core import duck_array_ops, formatting, utils
File "D:\Anaconda\lib\site-packages\xarray\core\duck_array_ops.py", line 26, in <module>
from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils
File "D:\Anaconda\lib\site-packages\xarray\core\npcompat.py", line 72, in <module>
_SupportsDType[np.dtype],
File "D:\Anaconda\lib\typing.py", line 275, in inner
return func(*args, **kwds)
File "D:\Anaconda\lib\typing.py", line 999, in __class_getitem__
_check_generic(cls, params, len(cls.__parameters__))
File "D:\Anaconda\lib\typing.py", line 209, in _check_generic
raise TypeError(f"{cls} is not a generic class")
TypeError: <class 'numpy.typing._dtype_like._SupportsDType'> is not a generic class
我的解答思路和尝试过的方法
在import dtale时候就报错了,不知道怎么回事