出现报错:no moudle named skimage

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_42427247/article/details/87089024

原因在于安装好的tensorflow并没有集成相关脚本库的原因。以Anaconda的tensorflow为例,解决方法:
(1)打开promot,激活tensorflow
(2)在tensorflow环境中用conda命令进行相关库安装:conda install scikit-image

展开阅读全文

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求大神解答! 问答

python 报错 ,显示ModuleNotFoundError: No module named 'exception'

05-02

显示错误,使用的是python3.6rn如果不能够使用这个模块,可以换成什么呢? 还是python3没有整个模块呢rnrn[code=python]Traceback (most recent call last):rn File "C:\Users\IBM\Desktop\商品信息.py", line 4, in rn from exception import ValueErrorrnModuleNotFoundError: No module named 'exception'[/code]rnrn[code=python]from lxml import html rnimport csv,os,jsonrnimport requestsrnfrom exception import ValueErrorrnfrom time import sleeprnrndef AmzonParser(url):rn headers = 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'rn page = requests.get(url,headers=headers)rn while True:rn sleep(3)rn try:rn doc = html.fromstring(page.content)rn XPATH_NAME = '//h1[@id="title"]//text()'rn XPATH_SALE_PRICE = '//span[contains(@id,"ourprice") or contains(@id,"saleprice")]/text()'rn XPATH_ORIGINAL_PRICE = '//td[contains(text(),"List Price") or contains(text(),"M.R.P") or contains(text(),"Price")]/following-sibling::td/text()'rn XPATH_CATEGORY = '//a[@class="a-link-normal a-color-tertiary"]//text()'rn XPATH_AVAILABILITY = '//div[@id="availability"]//text()'rnrn RAW_NAME = doc.xpath(XPATH_NAME)rn RAW_SALE_PRICE = doc.xpath(XPATH_SALE_PRICE)rn RAW_CATEGORY = doc.xpath(XPATH_CATEGORY)rn RAW_ORIGINAL_PRICE = doc.xpath(XPATH_ORIGINAL_PRICE)rn RAw_AVAILABILITY = doc.xpath(XPATH_AVAILABILITY)rnrn NAME = ' '.join(''.join(RAW_NAME).split()) if RAW_NAME else Nonern SALE_PRICE = ' '.join(''.join(RAW_SALE_PRICE).split()).strip() if RAW_SALE_PRICE else Nonern CATEGORY = ' > '.join([i.strip() for i in RAW_CATEGORY]) if RAW_CATEGORY else Nonern ORIGINAL_PRICE = ''.join(RAW_ORIGINAL_PRICE).strip() if RAW_ORIGINAL_PRICE else Nonern AVAILABILITY = ''.join(RAw_AVAILABILITY).strip() if RAw_AVAILABILITY else Nonernrn if not ORIGINAL_PRICE:rn ORIGINAL_PRICE = SALE_PRICErnrn if page.status_code!=200:rn raise ValueError('captha')rn data = rn 'NAME':NAME,rn 'SALE_PRICE':SALE_PRICE,rn 'CATEGORY':CATEGORY,rn 'ORIGINAL_PRICE':ORIGINAL_PRICE,rn 'AVAILABILITY':AVAILABILITY,rn 'URL':url,rn rnrn return datarn except Exception as e:rn print (e) rndef ReadAsin():rn # AsinList = csv.DictReader(open(os.path.join(os.path.dirname(__file__),"Asinfeed.csv")))rn AsinList = ['B0046UR4F4',rn 'B00JGTVU5A',rn 'B00GJYCIVK',rn 'B00EPGK7CQ',rn 'B00EPGKA4G',rn 'B00YW5DLB4',rn 'B00KGD0628',rn 'B00O9A48N2',rn 'B00O9A4MEW',rn 'B00UZKG8QU',]rn extracted_data = []rn for i in AsinList:rn url = "http://www.amazon.com/dp/"+irn print ("Processing: "+url)rn extracted_data.append(AmzonParser(url))rn sleep(5)rn f=open('data.json','w')rn json.dump(extracted_data,f,indent=4)rnrnrnif __name__ == "__main__":rn ReadAsin()rn[/code] 论坛

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