我不能进口熊猫
C:\Users\Yash\Desktop\Python\Twitter Sentimental Analysis>python import.py
Traceback (most recent call last):
File "C:\Users\Yash\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\__init__.py", line 26, in <module>
from pandas._libs import (hashtable as _hashtable,
File "C:\Users\Yash\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\_libs\__init__.py", line 4, in <module>
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
ModuleNotFoundError: No module named 'pandas._libs.tslib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "import.py", line 4, in <module>
import pandas as pd
File "C:\Users\Yash\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\__init__.py", line 35, in <module>
"the C extensions first.".format(module))
ImportError: C extension: No module named 'pandas._libs.tslib' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.我试着胡闹,但这个错误仍然存在。我已经和pip和python一起更新了模块!
这是该命令的完整回溯。
我目前使用的是python 3.6.6 (从官网下载)
pip版本: 18.1在windows 10笔记本电脑上运行!!
发布于 2019-02-06 01:15:35
我遇到了类似的问题,并通过手动卸载pandas,然后使用pip安装pandas解决了这个问题。你提到过你只更新了熊猫。所以我假设你没有尝试过重新安装它。
在这样做的同时,我的环境中的pandas版本从0.23.4更改为0.24.1
我的环境:
python 3.6.7
pip 18.1
注意:我也是Python使用的初学者。更有经验的用户可能知道更好的方法。
pip uninstall pandas
pip install pandas 上面的步骤解决了我的问题,我可以进口熊猫了。
我查看了pandas社区的发布说明,似乎对tslib的依赖已经被移除了。检查以下链接中的第1.5节,并搜索tslib。
http://pandas.pydata.org/pandas-docs/version/0.24/pandas.pdf
发布于 2019-09-02 22:58:04
我遇到了同样的错误,并通过调用以下命令解决了它:
pip uninstall pandas
pip install pandas
pip3 install --upgrade pandashttps://stackoverflow.com/questions/54093020
复制相似问题