ValueError:导入scipy.io后,源代码字符串不能包含空字节错误

2024-04-26 03:46:55 发布

您现在位置:Python中文网/ 问答频道 /正文

将scipy、numpy和pandas更新到最新版本后,每当我尝试在使用Python 3.7.4的Windows 10计算机上运行代码时,我都会收到以下错误:

Traceback (most recent call last):
  ...
  File "Path\To\MyClass.py", line 3, in <module>
    import scipy.io as sio
  File "Path\To\Anaconda\lib\site-packages\scipy\__init__.py", line 68, in <module>
    from ._lib.deprecation import _deprecated
  File "Path\To\Anaconda\lib\site-packages\scipy\_lib\__init__.py", line 12, in <module>
    from scipy._lib._testutils import PytestTester
ValueError: source code string cannot contain null bytes

这是最后一个文件的外观:

"""
Module containing private utility functions
===========================================

The ``scipy._lib`` namespace is empty (for now). Tests for all
utilities in submodules of ``_lib`` can be run with::

    from scipy import _lib
    _lib.test()

"""
from scipy._lib._testutils import PytestTester
test = PytestTester(__name__)
del PytestTester

我是遇到了bug还是我的设置被破坏了


Tags: topathinfrompyimportlibpackages