草庐IT

python打包后,执行报错:NameError: name ‘exit‘ is not defined

出现问题的伪代码如下:try:file_name=os.path.basename(src)file_size=os.stat(src).st_sizeexceptException:print("源文件不存在:",src)exit()在ide使用中没有问题,但是封装成应用程序时就出现问题:NameError:name'exit'isnotdefined百度了一圈后解决办法如下:将exit(),改为sys.exit()importsystry:file_name=os.path.basename(src)file_size=os.stat(src).st_sizeexceptException

Docker启动报错docker: Error response from daemon: Conflict. The container name “/redis6“ is already in u

docker启动报错docker:Errorresponsefromdaemon:Conflict.Thecontainername"/redis6"isalreadyinusebycontainer"b472e52c109bb5cfadf9dcd167b0e9a66f5215477a96673f0d60c7d07d7e746b".Youhavetoremove(orrename)thatcontainertobeabletoreusethatname.原因是:Centos7的内核过低或者过高的问题。拓展视频:腾讯最新前后端技术实战https://download.csdn.net/cours

Docker启动报错docker: Error response from daemon: Conflict. The container name “/redis6“ is already in u

docker启动报错docker:Errorresponsefromdaemon:Conflict.Thecontainername"/redis6"isalreadyinusebycontainer"b472e52c109bb5cfadf9dcd167b0e9a66f5215477a96673f0d60c7d07d7e746b".Youhavetoremove(orrename)thatcontainertobeabletoreusethatname.原因是:Centos7的内核过低或者过高的问题。拓展视频:腾讯最新前后端技术实战https://download.csdn.net/cours

[源码解析]ESPnet脚本源码解析-aishell-asr.sh

这段代码是ESPnet案例里面的aishell的asr里面的运行总脚本asr.sh传送门解析参数#!/usr/bin/envbash#Setbashto'debug'mode,itwillexiton:#-e'error',-u'undefinedvariable',-o...'errorinpipeline',-x'printcommands',set-eset-uset-opipefaillog(){localfname=${BASH_SOURCE[1]##*/}echo-e"$(date'+%Y-%m-%dT%H:%M:%S')(${fname}:${BASH_LINENO[0]}:${

[源码解析]ESPnet脚本源码解析-aishell-asr.sh

这段代码是ESPnet案例里面的aishell的asr里面的运行总脚本asr.sh传送门解析参数#!/usr/bin/envbash#Setbashto'debug'mode,itwillexiton:#-e'error',-u'undefinedvariable',-o...'errorinpipeline',-x'printcommands',set-eset-uset-opipefaillog(){localfname=${BASH_SOURCE[1]##*/}echo-e"$(date'+%Y-%m-%dT%H:%M:%S')(${fname}:${BASH_LINENO[0]}:${

TypeError: Cannot read properties of undefined (reading ‘NAME‘)报错解决

一、错误查找问题描述:前端一个el-table表格,一个医院查询到的科室从后端返回时总是显示不出来,response里面是有数据的,这个表格别的医院都能显示出科室,就那个医院显示不出。报错:TypeError:Cannotreadpropertiesofundefined(reading'NAME') 查找问题所在,发现el-table里面有一个:formatter="formatter_DepType",具体方法如下:constformatter_DepType=function(row,column){if(_this.Type_Ary&&row.DEP_TYPE){return_this

TypeError: Cannot read properties of undefined (reading ‘NAME‘)报错解决

一、错误查找问题描述:前端一个el-table表格,一个医院查询到的科室从后端返回时总是显示不出来,response里面是有数据的,这个表格别的医院都能显示出科室,就那个医院显示不出。报错:TypeError:Cannotreadpropertiesofundefined(reading'NAME') 查找问题所在,发现el-table里面有一个:formatter="formatter_DepType",具体方法如下:constformatter_DepType=function(row,column){if(_this.Type_Ary&&row.DEP_TYPE){return_this

conda-[win10执行.sh脚本]-win10在conda环境中用git bash执行sh脚本

conda-[win10执行.sh脚本]-win10在conda环境中用gitbash执行sh脚本1.问题背景2.解决方法2.1安装git2.2在conda环境中用gitbash运行sh脚本step1:step2:sourcestep3:激活你的环境2.3之后就可以愉快的执行conda命令和sh脚本了1.问题背景训练深度学习模型的时候,用的shell脚本执行训练过程。在本地搭建了win10+RTX3070+cuda11.1+cudnn8.0.4的环境。执行训练脚本的时候忽然意识到windows下没法执行shbash脚本。所以寻求能够运行sh脚本的方法。2.解决方法2.1安装git下载地址:ht

conda-[win10执行.sh脚本]-win10在conda环境中用git bash执行sh脚本

conda-[win10执行.sh脚本]-win10在conda环境中用gitbash执行sh脚本1.问题背景2.解决方法2.1安装git2.2在conda环境中用gitbash运行sh脚本step1:step2:sourcestep3:激活你的环境2.3之后就可以愉快的执行conda命令和sh脚本了1.问题背景训练深度学习模型的时候,用的shell脚本执行训练过程。在本地搭建了win10+RTX3070+cuda11.1+cudnn8.0.4的环境。执行训练脚本的时候忽然意识到windows下没法执行shbash脚本。所以寻求能够运行sh脚本的方法。2.解决方法2.1安装git下载地址:ht

用acme.sh给网站域名,申请免费SSL永久证书(自动续期)

一:简介申请ssl证书,即https有很多,有免费的,也有收费的。如第三方域名管理cloudflare也可以自动添加使用https,而且永久。但是由于有些服务,需要在服务器使用自签证书,所以需要自己申请。免费的可以使用certbot,也可以是使用zeroSSL。Cerbot可以参考我以前的文章:Certbot申请免费SSL证书这里,介绍使用acme.sh生成免费的ssl证书,其完整实现了acme协议,并且由纯Shell脚本语言编写,没有过多的依赖项,安装和使用都非常方便。对于zerossl官网,需要指出的是,用户可以在控制台直接申请证书,但免费用户最多只能申请3个,而使用ACME申请zeroS