Python 没有名为';熊猫;

Python 没有名为';熊猫;,python,pandas,module,pip,Python,Pandas,Module,Pip,我不能进口熊猫 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>

我不能进口熊猫

 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.
C:\Users\Yash\Desktop\Python\Twitter情感分析>Python import.py
回溯(最近一次呼叫最后一次):
文件“C:\Users\Yash\AppData\Local\Programs\Python\36\lib\site packages\pandas\\uuuuuuu init\uuuuuuuuu.py”,第26行,在
来自pandas._libsimport(哈希表为_哈希表,
文件“C:\Users\Yash\AppData\Local\Programs\Python\Python36\lib\site packages\pandas\\uuuuuu init\uuuuu.py”,第4行,在
从.tslib导入iNaT、NaT、Timestamp、Timedelta、OutOfBoundsDatetime
ModuleNotFoundError:没有名为“pandas.\u libs.tslib”的模块
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“import.py”,第4行,在
作为pd进口熊猫
文件“C:\Users\Yash\AppData\Local\Programs\Python\36\lib\site packages\pandas\\uuuuuuu init\uuuuuuuuu.py”,第35行,在
“C扩展优先。”。格式(模块))
ImportError:C扩展名:未生成名为“pandas._libs.tslib”的模块。如果要从源目录导入pandas,可能需要先运行“python setup.py build_ext--inplace--force”来构建C扩展。
我试着胡闹,但这个错误没有改变。 我已经更新了模块以及pip和python

这是该命令的完整回溯

我目前正在使用python 3.6.6(从官方网站下载)


pip版本:18.1在windows 10笔记本电脑上运行

我遇到了一个类似的问题,通过手动卸载pandas,然后使用pip安装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


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

pip uninstall pandas  
pip install pandas
pip3 install --upgrade pandas

可能是@Chris I更新了pandas的副本,但问题仍然存在!!我们需要更多信息:这是完整的回溯吗,你能在编辑器中导入熊猫吗,这是pyinstaller的错误吗,你在使用anaconda吗,你在运行mac windows linux等。关于重新安装的好建议。我没有卸载和重新安装,而是用所有最新的python、pandas、numpy、scipy等创建了一个conda环境,这也解决了问题。如果我没有pip呢。我不想拥有它。我的应用程序可以从命令行运行,但从PyCharm启动时出现此异常而失败