AttributeError: 'NoneType' object has no attribute 'shape'求指导

图片说明

2个回答

opencv很邪门,路径不错也会有读不出来的情况。
print 一下 roi 自己排查或者换绝对路径

richardclancy
richardclancy 解决了 确实有点邪门
4 个月之前 回复

我猜一下
你的path错了
结果什么都没读出来
所以是notype

GDXKSusie
GDXKSusie 回复richardclancy: 你好,我也遇到了同样的问题,请问一下,你的解决办法是什么呢?
14 天之前 回复
richardclancy
richardclancy 解决了 谢谢
4 个月之前 回复
qq_43656607
天不绝我 我确定,你的图片路径拼错了
4 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python 爬虫错误:AttributeError: 'NoneType' object has no attribute 'text'

用Python爬虫出现了题目所述的问题,求大神解答以下,救救小白吧,哭了 代码如下: Result=Soup.find('div',class_='tip-text ugc-ellipsis fade-text').text.strip() 错误提示: AttributeError Traceback (most recent call last) <ipython-input-58-c35c7a1014c4> in <module> ----> 1 Result=Soup.find('div',class_='tip-text ugc-ellipsis fade-text').text.strip() AttributeError: 'NoneType' object has no attribute 'text'

出现AttributeError: 'NoneType' object has no attribute 'to_csv'该怎么解决

用tushare获取股票指数数据,想要将数据输出保存 代码: import tushare as ts cons = ts.get_apis() df = ts.bar('sh', conn = cons, asset = 'INDEX', start_date='2010-01-01', end_date='') df.to_csv('sh.csv') 运行后出现这个错误: AttributeError: 'NoneType' object has no attribute 'to_csv' 希望各位大佬给个解决方法,谢谢!!

Python->Pyecharts->Geo在地图中加入自定义的点报错:AttributeError: 'NoneType' object has no attribute 'add'。

Geo在地图中加入自定义的点报错: AttributeError: 'NoneType' object has no attribute 'add' 原码: ``` from example.commons import Faker from pyecharts import options as opts from pyecharts.charts import Geo from pyecharts.globals import ChartType, SymbolType import pandas as pd import json # 链式调用 c = ( Geo() .add_schema(maptype="world") # 加入自定义的点,格式为 .add_coordinate("测试点", 116.39770014211535, 39.90779994986951) # 为自定义的点添加属性 .add("geo", [("测试点", 51)]) .set_series_opts(label_opts=opts.LabelOpts(is_show=False)) .set_global_opts(title_opts=opts.TitleOpts(title="宇宙中心呼唤爱")) ) # 在 html(浏览器) 中渲染图表 c.render() # 在 Jupyter Notebook 中渲染图表 c.render_notebook() ``` 报错: .add_coordinate("测试点", 116.39770014211535, 39.90779994986951) AttributeError: 'NoneType' object has no attribute 'add'

Python 程序报错 AttributeError: 'NoneType' object has no attribute 'commit'

Python 程序执行错误 AttributeError: 'NoneType' object has no attribute 'commit' 运行 Python 2.7.5 Mysql 5.7 CentOS 7.2

AttributeError: 'NoneType' object has no attribute 'append'

拟输出一个日期列表: ``` file=open("C:/Users/jyz_1/Desktop/新建文本文档.txt") file=file.read() lsy=[] dates=file.split("\n") for date in dates: while "-" in date: p1=date.index('-')#the first - p2=date.find('-',p1+1)#the second - month=date[p1+1:p2] day=date[p2+1:-1] date_on_x=int(month+day) lsy=lsy.append(date_on_x) ``` 报错: ``` Traceback (most recent call last): File "C:\Users\jyz_1\AppData\Local\Programs\Python\Python37-32\32rx.py", line 26, in <module> lsy=lsy.append(t) AttributeError: 'NoneType' object has no attribute 'append' ``` 难道lsy不是列表? 在shell中输入: ``` >>> lsy=[] >>> a='2015-1-1' >>> lsy.append(a) >>> lsy ['2015-1-1'] ``` 结果正常。 百思不得其解,求大神解惑。

出现AttributeError: 'NoneType' object has no attribute 'text'错误,无法解决....能答否?

今天在做爬虫练习时遇到: Traceback (most recent call last): File "C:\Users\Liangdawang\Desktop\crawler.py", line 7, in <module> print(title.text) AttributeError: 'NoneType' object has no attribute 'text' 本人小白 ,不知道为什么会出现这种错误,希望大佬解答仔细一点,还有就是对这种类型的解释以及类似的错误还有哪些 原代码: ``` from requests_html import HTMLSession session = HTMLSession() r = session.get('https://movie.douban.com/subject/1292052') title = r.html.find('#app > div > div > div.container > div:nth-child(6) > h3:nth-child(26) > b',first=True) print(title.text) ``` 错误截图: ![图片说明](https://img-ask.csdn.net/upload/201909/27/1569590119_512714.jpg)

为什么会出现AttributeError: 'NoneType' object has no attribute 'tobytes'求大神

ndex1 for i in range(img_list.__len__())] index1 += 1 img_data += img_list labels_data += label_list recorder_file = 'images/train.tfrecord' writer = tf.python_io.TFRecordWriter(recorder_file) for i in range(img_data.__len__()): im_d=img_data[i] im_l=labels_data[i] data= cv2.imread(im_d) #data = tf.gfile.FastGFile(im_d,'rb').read() #获得的是字节型不用转换,所获得的的包比OpenCV小 #将图片和标签封装 ex = tf.train.Example( features = tf.train.Features( feature = { 'image' : tf.train.Feature( bytes_list=tf.train.BytesList( value=[data.tobytes()] )), 'label' : tf.train.Feature( int64_list=tf.train.Int64List( value=[im_l] )), } ) ) writer.write(ex.SerializeToString()) print('everything is ok!') writer.close() ile "D:/2D/imgWrite.py", line 46, in <module> value=[data.tobytes()] AttributeError: 'NoneType' object has no attribute 'tobytes'

superset部署出现AttributeError: 'NoneType' object has no attribute 'datamodel'

执行刷新数据库 superset db upgrade 报错 ``` (env) ➜ incubator-superset-0.28.1 superset db upgrade INFO:root:logging was configured successfully /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_caching/__init__.py:202: UserWarning: Flask-Caching: CACHE_TYPE is set to null, caching is effectively disabled. "Flask-Caching: CACHE_TYPE is set to null, " Failed to create app Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 59, in create_app app_initializer.init_app() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 469, in init_app self.init_app_in_ctx() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 429, in init_app_in_ctx self.configure_fab() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 507, in configure_fab appbuilder.init_app(self.flask_app, db.session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/base.py", line 210, in init_app self.sm = self.security_manager_class(self) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/security/sqla/manager.py", line 63, in __init__ self.userstatschartview.datamodel = user_datamodel AttributeError: 'NoneType' object has no attribute 'datamodel' ERROR:superset.app:Failed to create app Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 59, in create_app app_initializer.init_app() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 469, in init_app self.init_app_in_ctx() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 429, in init_app_in_ctx self.configure_fab() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 507, in configure_fab appbuilder.init_app(self.flask_app, db.session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/base.py", line 210, in init_app self.sm = self.security_manager_class(self) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/security/sqla/manager.py", line 63, in __init__ self.userstatschartview.datamodel = user_datamodel AttributeError: 'NoneType' object has no attribute 'datamodel' Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.6/bin/superset", line 21, in <module> superset() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/cli.py", line 586, in main return super(FlaskGroup, self).main(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 1063, in invoke Command.invoke(self, ctx) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func return f(get_current_context(), *args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/cli.py", line 425, in decorator with __ctx.ensure_object(ScriptInfo).load_app().app_context(): File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/cli.py", line 381, in load_app app = call_factory(self, self.create_app) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask/cli.py", line 119, in call_factory return app_factory() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 66, in create_app raise ex File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 59, in create_app app_initializer.init_app() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 469, in init_app self.init_app_in_ctx() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 429, in init_app_in_ctx self.configure_fab() File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/superset/app.py", line 507, in configure_fab appbuilder.init_app(self.flask_app, db.session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/base.py", line 210, in init_app self.sm = self.security_manager_class(self) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/flask_appbuilder/security/sqla/manager.py", line 63, in __init__ self.userstatschartview.datamodel = user_datamodel AttributeError: 'NoneType' object has no attribute 'datamodel' ```

用BS爬取网页内容之后提取标签属性,显示AttributeError: 'NoneType' object has no attribute 'text'。用print可以成功提取出文本内容,放在循环里就出错。

用BS爬取网页内容之后标签属性一直出错,显示AttributeError: 'NoneType' object has no attribute 'text' 我用print在循环之前试过是可以成功提取出文本内容的,不知道为什么在循环里就不行。求大神解惑! ``` #s = content[0].find('h5',class_="result-sub-header") #print(s.text.strip()) #遍历content,取出结果 #因为find_all返回的是一个list,再对list用find_all时,需要指定元素[0] for i in range(len(content)): #提取标题 t = content[i].find('a',class_="title") title = t.text.strip() #提取链接 url = 'https://www.forrester.com'+t['href'] #提取摘要 s = content[i].find('h5',class_="result-sub-header") summary = s.text.strip() #将提取的内容放在列表paper中 paper = [title,'Cloud Migration',url,summary] #把每个paper加到paperlist paperlist.append(paper) ```

nonetype object has no attribute recv

在多线程模块threading中出现这样的问题nonetype object has no attribute recv,请问是哪里出错了,求大神看看

AttributeError: 'NoneType' object has no attribute 'read'该如何解决?

![图片说明](https://img-ask.csdn.net/upload/202004/10/1586509368_243912.png)

AttributeError: 'NoneType' object has no attribute 'group'???

![图片说明](https://img-ask.csdn.net/upload/201809/25/1537804947_240118.jpg) 新手,在选择下面这些内容时,报错,不太懂该怎末该??求大佬 ![图片说明](https://img-ask.csdn.net/upload/201809/25/1537805036_376602.jpg) ![图片说明](https://img-ask.csdn.net/upload/201809/25/1537804959_129886.jpg)

笨方法学python3上的习题43AttributeError: 'NoneType' object has no attribute 'enter',哪错了

from sys import exit from random import randint from textwrap import dedent class Scene(object): def enter(self): print("This scene is not yet configured.") print("Subclass it and implement enter().") exit(1) class Engine(object): def __init__(self,scene_map): self.scene_map = scene_map def play(self): current_scene = self.scene_map.opening_scene() last_scene = self.scene_map.next_scene('finished') while current_scene != last_scene: next_scene_name = current_scene.enter() current_scene = self.scene_map.next_scene(next_scene_name) # be sure to print out the last scene current_scene.enter() class Death(Scene): quips = [ "You died. You kinda suck at this.", "Your mom would be pround...if she were smarter.", "such a luser.", "I have a small puppy that's better st this.", "You're worse than your Dad's jokes.", ] def enter(self): print(Death.quips[randint(0, len(self.quips)-1)]) exit(1) class CentralCorridor(Scene): def enter(self): print(dedent(""" The Gothons of Planet Percal #25 have invaded your ship and destroyed your entire crew. You are the last surviving member and your last mission is to get the neutron destruct bomb from the Weapons Armory, put it in the bridge, and blow the ship up after getting into an escape pod. You're runing down the central corridor to the Weapons Armory when a Gothon jumps out, red scaly skin, dark grimy teeth, and evil clown costume flowing around his hate filled body. He's blocking the door to the Armory and zbout to pull a weapon to blast you. """)) action = input("> ") if action == "shoot!": print(dedent(""" Quick on the draw you yank out your blaster and fire it at the Gothon. His clown costume is flowing and moving around his body, which throws off your aim. Your laser hits his costume but misses him entirely. This completely ruins his brand new costume his mother bought him, which makes him fly into an insane rage and blast you repeattedly in the face until you are dead. Then he eats you. """)) return 'death' elif action == "dodge!": print(dedent(""" Lke a world class boxer you dodge, weave, slip and slide right as the Gothon's blaster cranks a laser past your head. In the middle of your artful dodge your foot slips and you bang your head on the metal wall and pass out. You wake up shortly after only to die as the Gothon stomps on your head and eats you. """)) return 'death' elif action == "tell a joke": print(dedent(""" Lucky for you they made you learn Gothon insults in the academy. You tell the one Gothon joke you know: Lbhe zbgure vf fb sng, jura fur fvgf nebhaq gur ubhfr, fur fvgf nebhaq gur ubhfr. The Gothon stops, tries not to laugh, then busts out laughing and can't move. While he's laughing you run up and shoot him square in the head putting him down, then through the Weapon Armory door. """)) return 'laser_weapon_armory' else: print("DOES NOT COMPUTE!") return 'central_corridor' class LaserWeaponArmory(Scene): def enter(self): print(dedent(""" Youd do a dive roll into the Weapon Armory, crouch and scan the room for more Gothons that might be hiding. It's dead quiet, too quiet,You stand up and run to the far side off the room and find the neutron bomb in its container. There's a keypad lock on box and you need the code to get the bomb out. If you get the code wrong 10 times then the lock closes forever and you can't get the bomb. The code is 3 digits. """)) code = f"{randint(1,9)}{randint(1,9)}{randint(1,9)}" guess = input("[keypad]> ") guesses = 0 while guess != code and guesses<10: print("BZZZZEDDD!") guesses += 1 guess = input("[keypad]> ") if guess == code: print(dedent(""" The container clicks open and the seal breaks, letting gas out. You grab the neutron bomb and run as fast as you can to the bridge where you must place it in the right spot. """)) return 'the bridge' else: print(dedent(""" The lock buzzes one last time and then you hear a sickening melting sound as the mechanism is fused together. You decide to sit there, and finally the Gothons blow up the ship from their ship and you die. """)) return 'death' class TheBridge(Scene): def enter(self): print(dedent(""" You burst onto the Bridge eith the entron destruct bomb under your arm and surprise 5 Gonthons who are trying to take control of the ship. Each of them has an even uglier clown sostume than last.They have't pulled their weapons out yet, as they see the active bomb under your arm and don't want to set it off. """)) action = input("> ") if action == "throw the bomb": print(dedent(""" In a panic you throw the bomb at group of Gothons and make a leap for the door. Right as you drop it a Gothon shoots you right in the back killing you. As you die you see another Gothon frantically try to disarm the bomb. You die knowing they will probably blow up when it goes off. """)) return 'death' elif action == "slowly place the bomb": print(dedent("""" You point your blaster at the bomb under your arm and the Gothons put their hands up adn start to sweat. You inch backward to the door, open it, and then carefully place the bomb on the floor, pointing your blaster at it. You then jump back through the door punch the close button and blast the lock so the Gothons can't get out. Now that bomb is placed you run to the escape pod to get off this tin can. """)) return 'escape_pod' else: print("DOES NOT COMPUTE!") return 'the_bridge' class EscapePod(Scene): def EscapePod(self): print(dedent(""" You rush through the ship desperately trying to make it to the escape pod before the whole ship explodes. It seems like hardly any Gothons are on the ship, so you run is clear of interference. You get to the chamber with the escape pods, and now need to pick one to take. Some of them could be damaged but you don't have time to look. There;s 5pods, which one do you take? """)) good_pod = randint(1,5) guess = input("[pod #> ") if int(guess) != good_pod: print(dedent(""" You jump into pod {guess} and hit the eject button. The pod escapes out into the void of space, then implodes as the hull ruptures, crushing your body into jam jelly. """)) return 'death' else: print(dedent(""" You jump into pod {guess} and hit the eject button. The pod easily slides out into space heading to the plantes below. As it flies to the planet, you look back and see your ship implode then explode like a bright star, taking out the Gothon ship at the same time. You won! """)) return 'finished' class Finished(Scene): def enter(self): print("You won! Good job.") return 'finished' class Map(object): scenes = { 'central_corridor': CentralCorridor(), 'laser_weapon_armory':LaserWeaponArmory(), 'the_bridge':TheBridge(), 'escape_pod':EscapePod(), 'death':Death(), 'finished':Finished(), } def __init__(self, start_scene): self.start_scene = start_scene def next_scene(self, scene_name): val = Map.scenes.get(scene_name) return val def opening_scene(self,): return self.next_scene(self.start_scene) a_map = Map('central_corrider') a_game = Engine(a_map) a_game.play() 返回结果: Traceback (most recent call last): File "F:/Python/test43.py", line 228, in <module> a_game.play() File "F:/Python/test43.py", line 18, in play next_scene_name = current_scene.enter() AttributeError: 'NoneType' object has no attribute 'enter' Process finished with exit code 1 看了好久,就是找不到是哪里错了,很烦

<AttributeError: 'str' object has no attribute 'decode'>,跪求大神解答。

``` from django.db import models # Create your models here. class Grades(models.Model): gname = models.CharField(max_length=20) gdate = models.DateTimeField() ggirlnum = models.IntegerField() gboynum = models.IntegerField() isDelete = models.BooleanField(default=False) class Students(models.Model): sname = models.CharField(max_length=20) sgender = models.BooleanField(default=True) sage = models.IntegerField() scontend = models.CharField(max_length=20) isDelete = models.BooleanField(default=False) # 关联外键 sgrade = models.ForeignKey(Grades, on_delete=models.CASCADE) ``` Django2.2, python3.7, 执行数据库迁移<python manage.py makemigrations>时报错,<AttributeError: 'str' object has no attribute 'decode'>

求助:AttributeError: type object 'Topic' has no attribute 'object'

python新手,求助个有关django的问题 django版本:2.1.5 python版本:3.6.0 问题如下: 项目路径\ learning_log 应用路径\learning_logs \learning_log\urls代码: from django.contrib import admin from django.urls import path,include urlpatterns = [ path('admin/', admin.site.urls), path('',include('learning_logs.urls')) ] \learning_logs.urls代码: from django.urls import path from . import views app_name = 'learning_logs' urlpatterns = [ path('',views.index,name='index'), path('topics/',views.topics,name='topics'), ] \learning_logs.views代码: from django.shortcuts import render from .models import Topic,Entry def index(request): return render(request,'learning_logs/index.html') def topics(request): a = Topic.object.order_by('date_added') context = {'topics':a} return render(request,'learning_logs/topics.html',context) \learning_logs.models代码: from django.db import models class Topic(models.Model): text = models.CharField(max_length=200) date_added = models.DateTimeField(auto_now_add=True) def __str__(self): return self.text class Entry(models.Model): topic = models.ForeignKey(Topic,on_delete=models.CASCADE) text = models.TextField() date_added = models.DateTimeField(auto_now_add=True) class Meta: verbose_name_plural = 'entries' def __str__(self): if len(self.text) < 50: return self.text else: return self.text[:50] + '...' 运行网页后: http://127.0.0.1:8000/ 显示如下,正常 Learning Log - Topics Learning Log helps you keep track of your learning, for any topic you're learning about. 运行 http://127.0.0.1:8000/Topic/ 后报错如下: AttributeError at /topics/ type object 'Topic' has no attribute 'object'

新手小白,求教AttributeError: 'property' object has no attribute 'cell'解决方案

#!/usr/bin/env python # -*- coding:utf-8 -*- #sys.path.append('C:\\Users\\steven\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\PIL') 求大神帮忙看看这段代码问题到底出在哪里? 环境:py3.6,库是Pillow5.4.1(64位),系统WIN7 64位。 错误提示: cell = worksheet.cell(column = col, row = row1) AttributeError: 'property' object has no attribute 'cell' from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl.styles import PatternFill, Color from PIL import Image workbook = Workbook() # 激活 worksheet worksheet = Workbook.active # 数据可以直接分配到单元格中 im = Image.open('D:\\pycharmfile\\excel_huatu\\2.jpg') im_width = im.size[0] im_height = im.size[1] pix = im.load() n = 1 for row1 in range(1, im_height): n = n + 1 for col in range(1, im_width): ** cell = worksheet.cell(column = col, row = row1)** #这是报错部分 pixprint = pix[col - 1, row1 - 1] pixColor = "FF%02X%02X%02X" % (pixpoint[0], pixpoint[1], pixpoint[2]) fill = PatternFill(patternType='solid', fgColor=Color(rgb=pixColor)) cell.fill = fill worksheet.row_dimensions[row1].height = 6 print('\r已完成:{:.2%}'.format(n/im_height), end = '') print('\n正在生成文件,请稍后。。。') for col in range(1, im_width): worksheet.column_dimensions[get_column_letter(col)].width = 1 workbook.save('D:\\pycharmfile\\excel_huatu\\20190326.xlsx') print('文件已生成!')

生成二维均匀分布的三维图报错AttributeError: 'int' object has no attribute 'ndim'?

* 生成二维均匀分布的三维图报错 * 代码如下: ``` from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax = fig.gca(projection='3d') x=np.arange(0,1,0.01) y=np.arange(0,1,0.01) X,Y=np.meshgrid(x,y) Z1=1 Z2=0 surf=ax.plot_surface(X,Y,Z1,color='b') surf=ax.plot_surface(X,Y,Z2,color='r') plt.show() ``` * 报错信息 Traceback (most recent call last): File "二维均匀分布.py", line 15, in <module> surf=ax.plot_surface(X,Y,Z1,color='b') File "E:\DataAnalysis\python-3.7.0\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 1610, in plot_surface if Z.ndim != 2: AttributeError: 'int' object has no attribute 'ndim' * 截图 ![图片说明](https://img-ask.csdn.net/upload/201904/15/1555301940_905474.jpg) 给底面Z=0和均匀分布的平面Z=1染色,但显示这个问题,搜索了下,基本上没有与这个相似的。。。请教该如何改啊!~

AttributeError: '----' object has no attribute 'driver'。

这几天公司做web自动化脚本,,等做完我用着好好的,别人一用突然有的能跑有的报这个错误, selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see AttributeError: 'BasicInformationCase' object has no attribute 'driver' 在网上找了很多类似的方法可是有的说setUp问题,关键我这个没有写setUp方法啊! 而且我的电脑就能都跑通,别人的电脑就有的能跑通,有的不能跑通,求助各位大神帮帮忙,看看什么原因 异常信息: 'Traceback (most recent call last): File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\software\python3.7.2\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "D:\software\python3.7.2\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 35, in BasicInformationCase text = self.__Demo(excelData,Number_of_cases, i, flow) File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 70, in __Demo self.__Init_driver_Chrome() File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 144, in __Init_driver_Chrome self.driver = webdriver.Chrome(executable_path='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe', chrome_options=options) # 启动浏览器 File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__ self.service.start() File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home 异常信息: 'Traceback (most recent call last): File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start stdin=PIPE) File "D:\software\python3.7.2\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "D:\software\python3.7.2\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 35, in BasicInformationCase text = self.__Demo(excelData,Number_of_cases, i, flow) File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 70, in __Demo self.__Init_driver_Chrome() File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 144, in __Init_driver_Chrome self.driver = webdriver.Chrome(executable_path='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe', chrome_options=options) # 启动浏览器 File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__ self.service.start() File "D:\software\python3.7.2\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home 异常信息: 'Traceback (most recent call last): File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 35, in BasicInformationCase text = self.__Demo(excelData,Number_of_cases, i, flow) File "D:\工作文件\自动化脚本\abc\Template\BasicInformationCase.py", line 77, in __Demo restext.append(bsm.BasicInformation_Son_Module(self.driver,excelData,Number_of_cases, i)) AttributeError: 'BasicInformationCase' object has no attribute 'driver'

selenium报错:'str' object has no attribute 'text'

在base里封装了获取文本框内容的方法 在page里调用此方法来获取错误提示框的内容 代码如下 ``` # 获取文本信息 方法封装 def base_get_text(self, loc): return self.base_find(loc).text # 获取错误提示信息 def page_get_error_info(self): return self.base_get_text(page.login_err_info).text ``` 运行结果如下 AttributeError: 'str' object has no attribute 'text'

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

6年开发经验女程序员,面试京东Java岗要求薪资28K

写在开头: 上周面试了一位女程序员,上午10::30来我们部门面试,2B哥接待了她.来看看她的简历: 个人简历 个人技能: ● 熟悉spring mvc 、spring、mybatis 等框架 ● 熟悉 redis 、rocketmq、dubbo、zookeeper、netty 、nginx、tomcat、mysql。 ● 阅读过juc 中的线程池、锁的源...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

SpringBoot系列之Redis缓存使用详细教程

Spring的缓存抽象 Spring从3.1开始定义了一系列抽象接口来统一不同的缓存技术;并支持使用Java Caching(JSR-107)注解简化我们进行缓存开发。Spring Cache 只负责维护抽象层,具体的实现由你的技术选型来决定。将缓存处理和缓存技术解除耦合。 JSR107 Java Caching(JSR-107)定义了5个核心接口,分别是CachingProvider, Cach...

推荐9个能让你看一天的网站

分享的这9个保证另你意外的网站,每个都非常实用!非常干货!毫不客气的说,这些网站最少值10万块钱。 利用好这些网站,会让你各方面的技能都得到成长,不说让你走上人生巅峰,但对比现在的你,在眼界、学识、技能方面都有质的飞跃。 一、AIRPANO 传送门:https://www.airpano.com/360photo_list.php 这是一个可以躺在家里,就能环游世界的神奇网站。 世界那么大,绝大多...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

月薪22K程序员,打卡迟到10次,收到工资短信一脸懵逼

每家公司为了保证公司员工每天的工作时间,一般都会采用上下班打卡的工作制度,这其实是一个很常见的是,本身也没有什么问题的。正所谓无规矩不成方圆,公司肯定是有公司的规矩,虽然每个员工都很不喜欢这些规矩来束缚我们,但是公司也只是为了能更好的管理员工。但是一家公司如果一成不变的使用打卡制度,而不会去变通管理,也真不一定是好事。 打卡制度特别对于销售部门来说,不但会让公司发展不起来,还很容易丢失员工。但如...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

程序员是做全栈工程师好?还是专注一个领域好?

昨天,有位大一的同学私信我,说他要做全栈工程师。 我一听,这不害了孩子么,必须制止啊。 谁知,讲到最后,更确定了他做全栈程序员的梦想。 但凡做全栈工程师的,要么很惨,要么很牛! 但凡很牛的,绝不是一开始就是做全栈的! 全栈工程师听起来好听,但绝没有你想象的那么简单。 今天听我来给你唠,记得帮我点赞哦。 一、全栈工程师的职责 如果你学习编程的目的只是玩玩,那随意,想怎么学怎么学。...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

​能让德国人放弃现金支付​,也没谁了

在新冠疫情中,德国人越来越多地选择在超市,加油站或其他商店付款时使用非接触式付款方式。德国信贷协会Deutschen Kreditwirtschaft (DK) 的一位发言人告诉德国新...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

原来实现钉钉自动签到如此简单,每天准时上下班不是梦

本文主要介绍了如何利用现成软件快速实现钉钉自动签到功能,核心思路非常简单,甚至无任何编程基础的小白也能轻松实现定时自动打卡功能.

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

讲真,这两款idea插件,能治愈你英语不好的病

时不时就有小伙伴问我,“二哥,能推荐一款 IDE 吗?”你看这话问的,现在搞 Java 的不都在用 Intellij IDEA 吗,还用得着推荐(我已经和 Eclipse 分手了)。然后小伙伴又说,“二哥,IDEA 支持中文吗?我英语不太好。”你看这话问的,搞编程的,英语不好是硬伤啊! 不过,随着 IDEA 最新版(版本号是 2020.1)的发布,英语不好的病可以彻底治愈了。为什么这么说呢?因为 ...

面试官给我挖坑:a[i][j] 和 a[j][i] 有什么区别?

点击上方“朱小厮的博客”,选择“设为星标”后台回复&#34;1024&#34;领取公众号专属资料本文以一个简单的程序开头——数组赋值:int LEN = 10000; int[][] ...

相关热词 c# 按行txt c#怎么扫条形码 c#打包html c# 实现刷新数据 c# 两个自定义控件重叠 c#浮点类型计算 c#.net 中文乱码 c# 时间排序 c# 必备书籍 c#异步网络通信
立即提问