首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有名为'pandas._libs.tslib‘的模块

没有名为'pandas._libs.tslib‘的模块
EN

Stack Overflow用户
提问于 2019-01-08 21:36:09
回答 2查看 31.4K关注 0票数 13

我不能进口熊猫

代码语言:javascript
复制
 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笔记本电脑上运行!!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-02-06 01:15:35

我遇到了类似的问题,并通过手动卸载pandas,然后使用pip安装pandas解决了这个问题。你提到过你只更新了熊猫。所以我假设你没有尝试过重新安装它。

在这样做的同时,我的环境中的pandas版本从0.23.4更改为0.24.1

我的环境:

python 3.6.7

pip 18.1

注意:我也是Python使用的初学者。更有经验的用户可能知道更好的方法。

代码语言:javascript
复制
pip uninstall pandas
pip install pandas 

上面的步骤解决了我的问题,我可以进口熊猫了。

我查看了pandas社区的发布说明,似乎对tslib的依赖已经被移除了。检查以下链接中的第1.5节,并搜索tslib。

http://pandas.pydata.org/pandas-docs/version/0.24/pandas.pdf

票数 17
EN

Stack Overflow用户

发布于 2019-09-02 22:58:04

我遇到了同样的错误,并通过调用以下命令解决了它:

代码语言:javascript
复制
pip uninstall pandas  
pip install pandas
pip3 install --upgrade pandas
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54093020

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档