脚本执行报错问题求助
来源:31-12 品牌和品牌分类接口 (proto同步脚本)
尼克2018
2022-01-19
def generate(self):
with cd(self.python_dir):
files = proto_file_list(self.python_dir)
print("files:",files)
subprocess.call("workon mxshop_srv", shell=True)
for file in files:
command = f"python -m grpc_tools.protoc --python_out=. --grpc_python_out=. -I. {file}"
subprocess.call(command)
修改我自己的python和go的路径后,执行脚本报错:
/bin/sh: workon: command not found
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'python -m grpc_tools.protoc --python_out=. --grpc_python_out=. -I. goods.proto'
写回答
1回答
-
尼克2018
提问者
2022-01-19
(): cd(.python_dir): files = proto_file_list(.python_dir) file files: command = filesubprocess.call(command, shell=True) py_files = generated_pyfile_list(.python_dir) file_name py_files: replace_file(file_name) (py_files) cd(.go_dir): files = proto_file_list(.go_dir) file files: command = filesubprocess.call(command, shell=True)
1.修改老师的代码:subprocess.call(command, shell=True) 2.分别在两个cd方法里调整。
022022-01-20
相似问题
add_config_watcher报错
回答 4
shell脚本报错
回答 3
老师,您好!channel死锁的问题
回答 2
python grpc超时机制有些疑问
回答 1
docker-compose up 报错
回答 1