module 'pandas' has no attribute 'datetime'
时间: 2023-09-30 17:04:26 浏览: 628
python中pandas处理日期时间
报错"module 'pandas' has no attribute 'datetime'"是因为你在导入pandas库时使用了错误的语法。正确的导入语法应该是`import pandas as pd`,然后你可以通过`pd.datetime`来引用datetime模块中的datetime类。所以你需要修改你的导入语句为`import pandas as pd`。
同时,根据引用中的解决办法,如果你错误地导入了`datetime.datetime`而不是`pandas.datetime`,那么你会遇到这个错误。在你的代码中,你应该使用`pd.datetime`而不是`datetime.datetime`。请确保你的导入和使用语法正确无误。
希望这个解答能帮到你!<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [解决pip安装,卸载第三方库的相关报错](https://blog.csdn.net/jackgaohahaha/article/details/123322622)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [type object ‘datetime.datetime‘ has no attribute ‘datetime‘的解决办法](https://blog.csdn.net/weixin_39130678/article/details/128132762)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [python报错: list object has no attribute shape的解决](https://download.csdn.net/download/weixin_38748721/13708867)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文