Home > other >  Python pandas error
Python pandas error

Time:12-04

Three lines of code, very simple reading excel file content, is always an error, pandas, various reinstall numpy is invalid,,,,
Pray god help
Df=pd read_excel ('./test. XLSX ', 'r', error_bad_lines=False, encoding="utf-8")
Df=df reset_index ()
Df. Head ()

An error as below -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Traceback (the most recent call last) :
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages/pandas/set py", 30, the line in & lt; module>
The from pandas. _libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages, pandas, _libs, set py", line 13, the in & lt; module>
The from pandas. _libs. Interval import interval
The File "pandas \ _libs \ interval pyx", line 1, the in the init pandas. _libs. Interval
The File "pandas \ _libs \ hashtable pyx", line 1, the in the init pandas. _libs. Hashtable
The File "pandas \ _libs \ missing pyx", line 1, the in the init pandas. _libs. Missing
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages \ pandas \ _libs \ tslibs \ set py", line 30, in & lt; module>
From the conversion import OutOfBoundsTimedelta, localize_pydatetime
The File "pandas \ _libs \ tslibs \ conversion pyx", line 1, the in the init pandas. _libs. Tslibs. Conversion
The File "pandas \ _libs \ tslibs \ timezones pyx", line 7, in the init pandas. _libs. Tslibs. Timezones
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages \ dateutil \ tz \ set py", line 2, the in & lt; module>
From the tz import *
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages \ dateutil \ tz \ tz py", line 19, in & lt; module>
Import the six
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ six py", line 6, the in & lt; module>
The import b
ModuleNotFoundError: No module named 'b'

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

Traceback (the most recent call last) :
The File "E:/PyCharm 2020.2.3 Python_job/one/Excel_chai py", line 1, the in & lt; module>
The import pandas as pd
The File "E: \ PyCharm 2020.2.3 \ Python_job \ one \ venv \ lib \ site - packages/pandas/set py", line 34, in & lt; 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.

CodePudding user response:

The parameters of the first, pandas. Read_excel () format, is the first time I see you this way, I think

CodePudding user response:

Second, it is suggested that the pandas and its related modules are uninstall reshipment try
 PIP uninstall six pytz python - dateutil numpy pandas 
PIP install pandas
  • Related