导入熊猫时导入错误

时间:2018-07-19 08:41:14

标签: python python-3.x pandas raspberry-pi raspbian

import pandas as pd 

导入熊猫时出现以下错误。谁能帮助我,我对python还是比较陌生的。我为此使用树莓,安装的操作系统是树莓操作系统。

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python3.5/dist-packages/pandas/__init__.py in <module>()
     25 try:
---> 26     from pandas._libs import (hashtable as _hashtable,
     27                              lib as _lib,

/usr/local/lib/python3.5/dist-packages/pandas/_libs/__init__.py in <module>()
      3 
----> 4 from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
      5 

ImportError: cannot import name 'iNaT'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-3-7dd3504c366f> in <module>()
----> 1 import pandas as pd

/usr/local/lib/python3.5/dist-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: 'iNaT' 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.

1 个答案:

答案 0 :(得分:0)

以这种方式安装:

sudo apt安装python3-pandas