ImportError: C extension: No module named ‘pandas._libs.tslib‘ not built.错误信息的解决方法

最近在使用pandas时,在import  pandas模块时,出现了以下的错误信息 :

ModuleNotFoundError: No module named 'pandas._libs.tslib'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-3-38d4b0363d82> in <module>
----> 1 import pandas

E:\soft\Anaconda\lib\site-packages\pandas\__init__.py in <module>
     33                       "pandas from the source directory, you may need to run "
     34                       "'python setup.py build_ext --inplace --force' to build "
---> 35                       "the C extensions first.".format(module))
     36 
     37 from datetime import datetime

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.

        后面,我在相应路径下,发现确实没有找到pandas._libs.tslib模块。后面在网上寻找方法时,发现问题更多的是用pyinstaller打包pandas时出现问题的解决办法。如果你没有使用pyinstaller打包的话,可以考虑使用我的解决方法,分享如下:

conda uninstall pandas
conda install pandas

      笔者在这里是使用conda直接进行移除的,没有安装anaconda的,可以使用pip uninstall pandas ,easy_install -m pandas等方法来进行移除,在这里就不详细介绍了。在卸载时候发现pandas的版本与python的版本不太一致,原因可能是不小心升级了python版本所导致的。

    原因待补充,欢迎各位朋友对于文章的不足之处进行指正~

  • 10
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

theskylife

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

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

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

打赏作者

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

抵扣说明:

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

余额充值