ImportError:无法在Keras中导入名称“ _ccallback_c”

时间:2018-08-06 18:31:22

标签: python keras importerror

当我尝试导入keras时发生导入错误。我对Tensorflow没问题,它在我的笔记本电脑上运行良好。我删除了Keras安装目录,然后重新安装了该目录,但仍然发生错误。我尝试使用较低版本的python,但仍然出现错误。

    Using TensorFlow backend.
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev\pydevd.py", line 1664, in <module>
    main()
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev\pydevd.py", line 1658, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev\pydevd.py", line 1068, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2018.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "C:/Users/yym30/PycharmProjects/Neurofiling/csv_practice/keras_prtc.py", line 2, in <module>
    from keras.datasets import mnist
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\utils\__init__.py", line 26, in <module>
    from .multi_gpu_utils import multi_gpu_model
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\utils\multi_gpu_utils.py", line 7, in <module>
    from ..layers.merge import concatenate
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\layers\__init__.py", line 4, in <module>
    from ..engine.base_layer import Layer
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\engine\__init__.py", line 8, in <module>
    from .training import Model
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\engine\training.py", line 21, in <module>
    from . import training_arrays
  File "C:\Users\yym30\Anaconda3\envs\Neurofiler\lib\site-packages\keras\engine\training_arrays.py", line 8, in <module>
    from scipy.sparse import issparse
  File "C:\Users\yym30\AppData\Roaming\Python\Python36\site-packages\scipy\__init__.py", line 118, in <module>
    from scipy._lib._ccallback import LowLevelCallable
  File "C:\Users\yym30\AppData\Roaming\Python\Python36\site-packages\scipy\_lib\_ccallback.py", line 1, in <module>
    from . import _ccallback_c
ImportError: cannot import name '_ccallback_c'

这是完整的错误消息。

1 个答案:

答案 0 :(得分:-1)

'_ ccallback_c'是从错误的位置被调用,拼写错误或不在目录中。