草庐IT

execute-attribute

全部标签

AttributeError: module ‘distutils‘ has no attribute ‘version‘

问题:AttributeError:module‘distutils’hasnoattribute‘version’.解决:setuptools版本问题”,版本过高导致的问题;setuptools版本第一步:pipuninstallsetuptools【使用pip,不能使用condauninstallsetuptools;【不能使用conda的命令,原因是,conda在卸载的时候,会自动分析与其相关的库,然后全部删除,如果y的话,整个环境都需要重新配置。第二步:pip或者condainstallsetuptools==59.5.0【现在最新的版本已经到了65了,之前的老版本只是部分保留,找不到

selenium 报错 DeprecationWarning: executable_path has been deprecated, please pass in a Service object

DeprecationWarning:executable_pathhasbeendeprecated,pleasepassinaServiceobjectdriver=webdriver.Chrome(executable_path='chromedriver.exe')出现DeprecationWarning警告的类型错误:该类型的警告大多属于版本已经更新,所使用的方法过时。查询当前版本重构后的函数,是之前的executable_path被重构到了Service函数里尝试解决方法:fromseleniumimportwebdriverfromselenium.webdriver.chrom

解决appium:‘WebDriver‘ object has no attribute ‘‘find_element_by_id

刚开始学习appium+Python+unittest自动化测试,写第一个测试用例就遇到了问题,代码非常简单,就是启动APP后隐隐等待10秒后开始定位元素进行点击操作,运行后结果就是,启动可以APP,但是到下一步操作的时候无法定位到具体元素,程序开始报错,30秒后自动退出APP。这里是源代码这个问题困扰了我很久,各种百度也没有解决,检查自己的环境也是没有问题最后才发现是webdriver.py文件里根本没有定义这种方法,这里我使用的是Python3.8。我的修改方法:将find_element_by_属性("value")改为 find_element("By.属性","value")修改后代

已解决:sqlalchemy.exc.ObjectNotExecutableError: Not an executable object‘......’的报错问题

问题场景:在flask框架中连接数据库,并测试数据库是否连接成功使用了mysql数据库和pymysql驱动问题描述inexecute  raiseexc.ObjectNotExecutableError(statement)fromerr  sqlalchemy.exc.ObjectNotExecutableError:Notanexecutableobject:'select1'这是错误的相关代码,在conn.execute()方法处抛出了错误db=SQLAlchemy(app)withapp.app_context():withdb.engine.connect()asconn:resul

Pytorch出现错误Attribute Error: module ‘torch‘ has no attribute ‘_six‘

1.问题描述:我是在VScode中使用jupyter拓展,远程连接服务器。2.torch版本:2.03.pytorch版本:1.9.14.问题原因:torch2.0版本以后中没有‘_six.py’文件5.如何查看torch中的py文件?我是用的anaconda,torch中的py文件位置为:/envs/环境名/lib/python版本号(比如:python3.8)/site-packages/torch6.解决办法(1)我第一开始试着把torch1.9中的’_six.py’文件复制到torch2.0中,发现还是不行(不知道为啥,有大佬能解释一下吗?)然后我又重新装了torch1.9.1,问题解

解决 AttributeError: module ‘numpy‘ has no attribute ‘int‘ 训练yolo时的问题

在运行yolov5的train.py出现这个报错结果。看其他博主说的是因为库版本不对应,需要更换python或numpy版本;原因:numpy.int在NumPy1.20中已弃用,在NumPy1.24中已删除。解决方式:将numpy.int更改为numpy.int_,int。本人一开始试了上述方法,报出了别的错,继续修改,又返回了这个报错结果。本人方法1.打开yolov5的requestment.txt,将numpy的版本设置改为==(因为>=,会默认安装最新版本,而最新版本的numpy中没有numpy,int,所以需要降低numpy的版本) 2.重新运行pipinstall-rrequire

【经验总结】keil报错:declaration may not appear after executable statement in block···

问题原因:今天在keil平台上移植一段STM32代码,编译的时候一直出现报错,找了半天也找不到原因,最后通过百度通过大佬们的博文找到了原因,因为每个keil工程的STM32标准库和MDK环境设置不同,具体错误如下:解决办法:解决办法有两种。第一种方法:将所有变量声明提到最上面部分,包括结构体,即定义变量不能在执行语句之后改变以后如下:第二种方法:打开上面工具栏小锤子点击C/C++按钮,勾选C99mode选项,因为这个版本兼容所有代码格式点击OK,配置完成。这样就没有报错啦。

关于 【AttributeError: module ‘collections‘ has no attribute ‘Mapping‘】出现的问题

    这个错误通常是由于在Python3.9或更高版本中,从以上图片中看到的版本是Python3.11,`collections.Mapping`被删除所致。如果使用的是旧版本的代码,可能会导致此错误。解决此问题的方法是将代码中的`Mapping`替换为`abc.Mapping`。例如,将以下代码: fromcollectionsimportMapping替换为:fromcollections.abcimportMapping这将导入`collections.abc`模块中的`Mapping`类,以替代`collections`模块中的已删除类。如果你使用的是Python3.8或更早版本,则

cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘错误解决方法

importalbumentationsasA报错:cv2‘hasnoattribute‘gapi_wip_gst_GStreamerPipeline解决方法:pip3install--user--upgradeopencv-python-ihttps://pypi.tuna.tsinghua.edu.cn/simple网友的方法是卸载opencv-contrib-pythonuninstallopencv-contrib-pythonAttributeError:module‘cv2‘hasnoattribute‘gapi_wip_gst_GStreamerPipeline‘_killvir

SpringBoot——单元测试error: can not execute. because can not find cache of TableInfo for entity!

问题  单元测试时,遇到以下报错:com.baomidou.mybatisplus.core.exceptions.MybatisPlusException:error:cannotexecute.becausecannotfindcacheofTableInfoforentity! atcom.baomidou.mybatisplus.core.toolkit.ExceptionUtils.mpe(ExceptionUtils.java:49) atcom.baomidou.mybatisplus.core.toolkit.Assert.isTrue(Assert.java:38) atco