Python C扩展名:没有名为';熊猫;未建成

Python C扩展名:没有名为';熊猫;未建成,python,pandas,importerror,Python,Pandas,Importerror,我从熊猫那里得到一个持续的错误: In [3]: import pandas --------------------------------------------------------------------------- ImportError Traceback (most recent call last) C:\Users\swan\AppData\Roaming\Python\Python35\site-packages

我从熊猫那里得到一个持续的错误:

In [3]: import pandas
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Users\swan\AppData\Roaming\Python\Python35\site-packages\pandas\__init__.py in <module>()
     25 try:
---> 26     from pandas._libs import (hashtable as _hashtable,
     27                              lib as _lib,

ImportError: No module named 'pandas._libs'

During handling of the above exception, another exception occurred:

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

C:\Users\swan\AppData\Roaming\Python\Python35\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' not built. If you want to import pandas from the source dir
ectory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.

我也遇到了同样的问题,我按照以下方式修复了它:

  • 卸载熊猫“pip卸载熊猫”
  • 从下载源代码
  • 在文件夹中打开终端/命令提示符
  • 运行“python setup.py build_ext--force”
  • 运行“python setup.py安装”

好了。

我也遇到了同样的问题,我按如下方式修复了它:

  • 卸载熊猫“pip卸载熊猫”
  • 从下载源代码
  • 在文件夹中打开终端/命令提示符
  • 运行“python setup.py build_ext--force”
  • 运行“python setup.py安装”

好了。

当你
pip安装--强制重新安装pandas时会发生什么?@r.ook我已经编辑了这篇文章来说明在这种情况下会发生什么。在这种情况下,请尝试
pip安装--强制--重新安装pandas--忽略已安装的六个
。当您安装
pandas
时,听起来好像出了什么问题。希望重新安装能起作用,如果不行,我不太确定。@r.ook这是我的解决方案!为了让它工作,我必须通过anaconda navigator并安装CMD.exe提示符,以便修改我的环境。然后我在那里使用了你的命令,它成功了!谢谢你,我处理这个问题已经好几个小时了。当你
pip安装--强制重新安装pandas时会发生什么情况?@r.ook我编辑了这篇文章来说明在这种情况下会发生什么。在这种情况下,请尝试
pip安装--强制--重新安装pandas--忽略已安装的六个
。当您安装
pandas
时,听起来好像出了什么问题。希望重新安装能起作用,如果不行,我不太确定。@r.ook这是我的解决方案!为了让它工作,我必须通过anaconda navigator并安装CMD.exe提示符,以便修改我的环境。然后我在那里使用了你的命令,它成功了!谢谢你,我处理这个问题已经好几个小时了
C:\Windows\system32>pip install --force-reinstall pandas
Collecting pandas
  Using cached pandas-0.24.2-cp35-cp35m-win_amd64.whl (8.5 MB)
Collecting numpy>=1.12.0
  Using cached numpy-1.18.4-cp35-cp35m-win_amd64.whl (12.7 MB)
Collecting python-dateutil>=2.5.0
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting pytz>=2011k
  Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 50 kB/s
Collecting six>=1.5
  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: numpy, six, python-dateutil, pytz, pandas
  Attempting uninstall: numpy
    Found existing installation: numpy 1.18.4
    Uninstalling numpy-1.18.4:
      Successfully uninstalled numpy-1.18.4
  Attempting uninstall: six
    Found existing installation: six 1.10.0
ERROR: Cannot uninstall 'six'. It is a distutils installed project and thus we cannot accurately determine which fil
es belong to it which would lead to only a partial uninstall.