【发布时间】:2019-06-03 05:13:30
【问题描述】:
我无法导入熊猫
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 笔记本电脑上运行!!
【问题讨论】:
-
@Chris 我更新了熊猫,但问题仍然存在!
-
我们需要更多信息:这是完整的回溯吗,您可以在编辑器中导入 pandas,pyinstaller 是否出现此错误,您是否使用 anaconda,您是否正在运行 mac windows linux 等。