AttributeError 测试文章

----
AttributeError                            Traceback (most recent call last)Cell In[37], line 3      1 import matplotlib.pyplot as plt      2 import numpy as np----> 3 import pandas as pd      4 import parselmouthFile D:\Python\CondaEnvs\Praat\Lib\site-packages\pandas\__init__.py:37     30     _module = _err.name     31     raise ImportError(     32         f"C extension: {_module} not built. If you want to import "     33         "pandas from the source directory, you may need to run "     34         "'python setup.py build_ext' to build the C extensions first."     35     ) from _err---> 37 from pandas._config import (     38     get_option,     39     set_option,     40     reset_option,     41     describe_option,     42     option_context,     43     options,     44 )     46 # let init-time option registration happen     47 import pandas.core.config_init  # pyright: ignore[reportUnusedImport] # noqa: F401File D:\Python\CondaEnvs\Praat\Lib\site-packages\pandas\_config\__init__.py:20      1 """      2 pandas._config is considered explicitly upstream of everything else in pandas,      3 should have no intra-pandas dependencies.   (...)      6 are initialized.      7 """      8 __all__ = [      9     "config",     10     "detect_console_encoding",   (...)     18     "warn_copy_on_write",     19 ]---> 20 from pandas._config import config     21 from pandas._config import dates  # pyright: ignore[reportUnusedImport]  # noqa: F401     22 from pandas._config.config import (     23     _global_config,     24     describe_option,   (...)     29     set_option,     30 )File D:\Python\CondaEnvs\Praat\Lib\site-packages\pandas\_config\config.py:68     58 from typing import (     59     TYPE_CHECKING,     60     Any,   (...)     64     cast,     65 )     66 import warnings---> 68 from pandas._typing import (     69     F,     70     T,     71 )     72 from pandas.util._exceptions import find_stack_level     74 if TYPE_CHECKING:File D:\Python\CondaEnvs\Praat\Lib\site-packages\pandas\_typing.py:198    192 Frequency = Union[str, "BaseOffset"]    193 Axes = ListLike    195 RandomState = Union[    196     int,    197     np.ndarray,--> 198     np.random.Generator,    199     np.random.BitGenerator,    200     np.random.RandomState,    201 ]    203 # dtypes    204 NpDtype = Union[str, np.dtype, type_t[Union[str, complex, bool, object]]]AttributeError: module 'numpy.random' has no attribute 'Generator'

原因

conda 与 numpy版本不一致

解决方法

pip uninstall conda numpy

pip install conda numpy

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小风XFS

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值