pandas新建excel文件报错:raise AttributeError(__former_attrs__[attr]) AttributeError: module numpy has no attribute float
时间: 2023-11-26 21:54:20 浏览: 643
这个错误可能是因为你的 Pandas 和 Numpy 版本不兼容导致的。尝试更新 Numpy 到最新版本,或者降低 Pandas 版本。
你可以尝试以下步骤:
1. 卸载 numpy 和 pandas:
```
pip uninstall numpy
pip uninstall pandas
```
2. 安装最新版本的 numpy:
```
pip install numpy --upgrade
```
3. 安装 Pandas:
```
pip install pandas
```
如果你已经安装了最新版本的 numpy,但问题仍然存在,那么你可以尝试降低 Pandas 版本,例如:
```
pip install pandas==0.23.4
```
希望这能解决你的问题。
相关问题
pandas AttributeError: module 'numpy' has no attribute '__version__'
出现"AttributeError: module 'numpy' has no attribute '__version__'"的错误通常是因为numpy版本过低导致的。解决这个问题的方法是升级numpy到最新版本。可以使用以下命令升级numpy:
```shell
pip install --upgrade numpy
```
如果你已经升级了numpy但仍然出现这个错误,那么可能是因为你的numpy安装出现了问题。可以尝试重新安装numpy来解决这个问题:
```shell
pip uninstall numpy
pip install numpy
```
pyspark toPandas报错 AttributeError: module 'numpy' has no attribute 'bool'.
这个报错主要是因为pandas和numpy版本不匹配所致。你可以尝试更新pandas包来解决这个问题,可以使用以下命令:
pip install --upgrade --index https://pypi.mirrors.ustc.edu.cn/simple/ pandas
更新完pandas包后,再次尝试运行pyspark toPandas命令,应该就不会再出现"AttributeError: module 'numpy' has no attribute 'bool'"的错误了。
阅读全文
相关推荐
















