当我尝试导入 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'
这是完整的错误信息。
'_ccallback_c' 要么从错误的位置被调用,要么拼写错误,要么不在目录中。
我是一名优秀的程序员,十分优秀!