No module named zope.interface error的解决

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/dipolar/article/details/53333987
    明明安装了 zope.interface,还是出现标题错误,错误语句是
from zope.interface import ooxx
    根据 http://stackoverflow.com/questions/11010412/importerror-no-module-named-zope-interface 帖子的提示,原因是zope目录下缺一个__init__文件,这个文件干什么的,具体看Python模块资料吧,解决办法就是在zope目录下面新建一个__init__空文件即可解决问题。
展开阅读全文

ubuntu下调用keras报错:No module named 'error'

09-13

cuda9.0和TensorFlow1.8.0已安装rnimport tensorflow也没有问题,就是再import keras出错,求大神解答!rn报错如下:rnUsing TensorFlow backend.rnTraceback (most recent call last):rn File "/home/zhangzhiyang/PycharmProjects/tensorflow1/test_keras.py", line 2, in rn import kerasrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/__init__.py", line 3, in rn from . import utilsrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/__init__.py", line 26, in rn from .multi_gpu_utils import multi_gpu_modelrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/utils/multi_gpu_utils.py", line 7, in rn from ..layers.merge import concatenatern File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/layers/__init__.py", line 4, in rn from ..engine.base_layer import Layerrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/__init__.py", line 7, in rn from .network import get_source_inputsrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/keras/engine/network.py", line 9, in rn import yamlrn File "/home/zhangzhiyang/anaconda3/envs/tensorflow/lib/python3.6/site-packages/yaml/__init__.py", line 2, in rn from error import *rnModuleNotFoundError: No module named 'error'rnrnrnrnrn我的版本:tensorflow1.8.0,cuda9.0,cuDNN7,anaconda3,python3.6.5rn我的tensorflow和keras安装路径均为anaconda3/envs/tensorflow/lib/python3.6/site-packagesrnrn我的.bashrc文件如下:rnrnexport PATH="/home/zhangzhiyang/anaconda3/bin:$PATH"rnexport LD_LIBRARY_PATH="/home/zhangzhiyang/newdisk/cuda-9.0/lib64:$LD_LIBRARY_PATH"rnexport PATH="/home/zhangzhiyang/newdisk/cuda-9.0/bin:$PATH"rnexport CUDA_HOME=$CUDA_HOME:"/home/zhangzhiyang/newdisk/cuda-9.0"rnrnrnrn个人推测可能是python版本的问题,但不知如何解决,我第一次pip Keras未指定安装路径,结果keras安装在了python2.7下,这次我指定了路径为python3.6/site_packages,但是报了如上错误,是否keras不支持python3?rnrn求大神解答! 问答

没有更多推荐了,返回首页