python Pandas报错

很简单的三行代码,读excel文件内容,总是报错,pandas、numpy各种重新安装无效。。。。
求大神帮助
df = pd.read_excel('./test.xlsx','r',error_bad_lines=False, encoding='utf-8')
df = df.reset_index()
df.head()

报错如下-----------------------------------------------------------------
Traceback (most recent call last):
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\pandas\__init__.py", line 30, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\pandas\_libs\__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas\_libs\interval.pyx", line 1, in init pandas._libs.interval
  File "pandas\_libs\hashtable.pyx", line 1, in init pandas._libs.hashtable
  File "pandas\_libs\missing.pyx", line 1, in init pandas._libs.missing
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\pandas\_libs\tslibs\__init__.py", line 30, in <module>
    from .conversion import OutOfBoundsTimedelta, localize_pydatetime
  File "pandas\_libs\tslibs\conversion.pyx", line 1, in init pandas._libs.tslibs.conversion
  File "pandas\_libs\tslibs\timezones.pyx", line 7, in init pandas._libs.tslibs.timezones
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\dateutil\tz\__init__.py", line 2, in <module>
    from .tz import *
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\dateutil\tz\tz.py", line 19, in <module>
    import six
  File "E:\PyCharm 2020.2.3\Python_job\one\six.py", line 6, in <module>
    import b
ModuleNotFoundError: No module named 'b'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:/PyCharm 2020.2.3/Python_job/one/Excel_chai.py", line 1, in <module>
    import pandas as pd
  File "E:\PyCharm 2020.2.3\Python_job\one\venv\lib\site-packages\pandas\__init__.py", line 34, in <module>
    raise ImportError(
ImportError: C extension: No module named 'b' 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.

 

查看全部
weixin_43143676
陆玮
2020/12/03 14:42
  • python
  • 点赞
  • 收藏
  • 回答
    私信

4个回复