如何解决问题“ AttributeError:模块'linecache'没有属性'checkcache'”

时间:2019-03-30 05:54:29

标签: python numpy

我正在尝试导入Numpy

import numpy as np

但我收到此错误:

AttributeError: module 'linecache' has no attribute 'checkcache'

完整跟踪:

Traceback (most recent call last):

  File "C:/Users/z1885/Desktop/鸡行为分析/codepy/ML/KNN.py", line 1, in <module>
    import numpy as np

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\numpy\__init__.py", line 145, in <module>
    from . import lib

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\numpy\lib\__init__.py", line 24, in <module>
    from .npyio import *

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\numpy\lib\npyio.py", line 14, in <module>
    from ._datasource import DataSource

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\numpy\lib\_datasource.py", line 41, in <module>
    import shutil

  File "C:\Users\z1885\Desktop\bouk\venv\lib\shutil.py", line 16, in <module>
    import bz2

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\bz2.py", line 18, in <module>
    from threading import RLock

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\threading.py", line 7, in <module>
    from traceback import format_exc as _format_exc

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\traceback.py", line 5, in <module>
    import linecache

  File "C:\Users\z1885\Desktop\bouk\venv\lib\linecache.py", line 11, in <module>
    import tokenize

  File "C:\Users\z1885\Desktop\bouk\venv\lib\tokenize.py", line 34, in <module>
    from token import *

  File "C:\Users\z1885\Desktop\鸡行为分析\codepy\token.py", line 5, in <module>
    import request as request

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\request\__init__.py", line 2, in <module>
    from get import GET

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\get\__init__.py", line 3, in <module>
    from query_string import query_string

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\query_string\__init__.py", line 18, in <module>
    @public.add

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\public\__init__.py", line 65, in add
    return _add(_caller_modules()[1], objects)

  File "C:\Users\z1885\Desktop\bouk\venv\lib\site-packages\public\__init__.py", line 12, in _caller_modules
    frames = inspect.getouterframes(inspect.currentframe())

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\inspect.py", line 1441, in getouterframes
    frameinfo = (frame,) + getframeinfo(frame, context)

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\inspect.py", line 1414, in getframeinfo
    lines, lnum = findsource(frame)

  File "C:\Users\z1885\AppData\Local\Programs\Python\Python35\Lib\inspect.py", line 747, in findsource
    linecache.checkcache(file)
AttributeError: module 'linecache' has no attribute 'checkcache'

0 个答案:

没有答案