ImportError: cannot import name ‘DtypeArg‘ from ‘pandas
Posted Data+Science+Insight
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ImportError: cannot import name ‘DtypeArg‘ from ‘pandas相关的知识,希望对你有一定的参考价值。
ImportError: cannot import name 'DtypeArg' from 'pandas
目录
ImportError: cannot import name 'DtypeArg' from 'pandas
问题:
import pandas as pd
解决:
这是Pandas==1.3.1中的一个bug。
一个可能的解决方案是将其降级到某个早期版本,例如pip install pandas==1.3.0
或者直接pip install pandas
完整错误:
Traceback (most recent call last):
File "test.py", line 2, in <module>
import pandas as pd
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\__init__.py", line 142, in <module>
from pandas.io.api import (
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\io\\api.py", line 8, in <module>
from pandas.io.excel import ExcelFile, ExcelWriter, read_excel
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\io\\excel\\__init__.py", line 1, in <module>
from pandas.io.excel._base import ExcelFile, ExcelWriter, read_excel
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\io\\excel\\_base.py", line 32, in <module>
from pandas.io.parsers import TextParser
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\io\\parsers\\__init__.py", line 1, in <module>
from pandas.io.parsers.readers import (
File "D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\io\\parsers\\readers.py", line 17, in <module>
from pandas._typing import (
ImportError: cannot import name 'DtypeArg' from 'pandas._typing' (D:\\anaconda\\envs\\deploy_test\\lib\\site-packages\\pandas\\_typing.py)
参考:ImportError: cannot import name 'DtypeArg' from 'pandas
参考:pandas
以上是关于ImportError: cannot import name ‘DtypeArg‘ from ‘pandas的主要内容,如果未能解决你的问题,请参考以下文章
解决 ImportError: cannot import name pywrap_tensorflow
ImportError: cannot import name webdriver
ImportError: cannot import name patterns
window环境下ImportError: cannot import name 'Bar' from 'pyecharts'