ValueError:源代码字符串不能包含在Python中导入pandas的空字节

问题描述 投票:0回答:1

当我尝试在 python 代码中导入 pandas 时,它给了我错误:

    File "Traceback (most recent call last):
  File "c:\Users\Adrian\Desktop\alkemy\src\py_functions\transform_univ_jfk.py", line 4, in <module>
    import pandas as pd
  File "C:\Users\Adrian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\__init__.py", line 141, in <module>
    from pandas.io.api import (
  File "C:\Users\Adrian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\io\api.py", line 6, in <module>
    from pandas.io.excel import (
  File "C:\Users\Adrian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\io\excel\__init__.py", line 1, in <module>
    from pandas.io.excel._base import (
  File "C:\Users\Adrian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\io\excel\_base.py", line 75, in <module>
    from pandas.io.parsers import TextParser
  File "C:\Users\Adrian\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pandas\io\parsers\__init__.py", line 1, in <module>
    from pandas.io.parsers.readers import (
ValueError: source code string cannot contain null bytes

我直到大约一个月前都在使用python,没有错误,我表弟用了我的电脑几天,我不知道她做了什么,我重新安装了python,但它仍然给我错误

python pandas
1个回答
0
投票

我通过卸载并重新安装 Python 修复了此错误

© www.soinside.com 2019 - 2024. All rights reserved.