当前位置: 首页 > news >正文

wordpress可以做下载站织梦医院网站源码

wordpress可以做下载站,织梦医院网站源码,网站毕业设计代做,四川省住建厅特种作业资格证大家好,本文将围绕python作业提交什么文件展开说明,python123怎么提交作业是一个很多人都想弄明白的事情,想搞清楚python期末作业程序需要先了解以下几个事情。 火车头采集ai伪原创插件截图: I have a python project, whose fold…

大家好,本文将围绕python作业提交什么文件展开说明,python123怎么提交作业是一个很多人都想弄明白的事情,想搞清楚python期末作业程序需要先了解以下几个事情。

 

火车头采集ai伪原创插件截图:

I have a python project, whose folder has the structure

main_directory - lib - lib.py

- run - .py

.py is

from lib.lib import add_two

spark = SparkSession \

.builder \

.master('yarn') \

.appName('') \

.getOrCreate()

print(add_two(1,2))

and lib.py is

def add_two(x,y):

return x+y

I want to launch as a Dataproc job in GCP. I have checked online, but I have not understood well how to do it. I am trying to launch the with

gcloud dataproc jobs submit pyspark --cluster=$CLUSTER_NAME --region=$REGION \

run/.py

But I receive the following error message:

from lib.lib import add_two

ModuleNotFoundError: No module named 'lib.lib'

Could you help me on how I should do to launch the job on Dataproc? The only way I have found to do it is to remove the absolute path, making this change to .py:

from lib import add_two

and the launch the job as

gcloud dataproc jobs submit pyspark --cluster=$CLUSTER_NAME --region=$REGION \

--files /lib/lib.py \

/run/.py

However, I would like to avoid the tedious process to list the files manually every time.

Following the suggestion of @Igor, to pack in a zip file I have found that

zip -j --update -r libpack.zip /projectfolder/* && spark-submit --py-files libpack.zip /projectfolder/run/.py

works. However, this puts all files in the same root folder in libpack.zip, so if there were files with the same names in subfolders this would not work.

Any suggestions?

解决方案

To zip the dependencies -

cd base-path-to-python-modules

zip -qr deps.zip ./* -x .py

Copy deps.zip to hdfs/gs. Use uri when submitting the job as shown below.

Submit a python project (pyspark) using Dataproc' Python connector

from google.cloud import dataproc_v1

from google.cloud.dataproc_v1.gapic.transports import (

job_controller_grpc_transport)

region =

cluster_name =

project_id =

job_transport = (

job_controller_grpc_transport.JobControllerGrpcTransport(

address='{}-dataproc.googleapis.com:443'.format(region)))

dataproc_job_client = dataproc_v1.JobControllerClient(job_transport)

job_file =

# command line for the main job file

args = ['args1', 'arg2']

# required only if main python job file has imports from other modules

# can be one of .py, .zip, or .egg.

addtional_python_files = ['hdfs://path/to/deps.zip', 'gs://path/to/moredeps.zip']

job_details = {

'placement': {

'cluster_name': cluster_name

},

'pyspark_job': {

'main_python_file_uri': job_file,

'args': args,

'python_file_uris': addtional_python_files

}

}

res = dataproc_job_client.submit_job(project_id=project_id,

region=region,

job=job_details)

job_id = res.reference.job_id

print(f'Submitted dataproc job id: {job_id}')

http://www.yayakq.cn/news/371169/

相关文章:

  • 网站设计范例呼和浩特城乡建设网站
  • 网站前端做报名框代码制作安卓app的软件
  • 做图网站有哪些东西吗网页设计师职业规划
  • 手绘风网站太原免费静态网页制作网站
  • 网站预付款怎么做会计分录温江 网站建设
  • 惠州搜索引擎seoseo排名需要多少钱
  • 做门户网站用什么技术好制作网页网站项目介绍
  • 全国优秀作文网站vue做移动端网站与pc端有什么区别
  • 观澜小学 网站建设南昌专业做网站公司有哪些
  • 东莞网站网站建设.net 网站生成安装文件目录
  • 淘宝联盟推广做网站违法搭建网站属于什么专业
  • 源码快速建站百度广告投放技巧
  • 建设工程信息网官网新网站网站设计 验收标准
  • 阿里云建设个人网站做刷题网站赚钱么
  • 网站硬件方案有没有教做韩餐的网站
  • 海南做网站的模具做外贸网站
  • 小程序制作网站在线设计平台官网
  • 类似freenom的免费域名网站做营销网站哪家好
  • 网站api怎么做的深圳企业管理咨询公司
  • 营销型网站举例找网站建设
  • 公司网站如何在百度上能搜索到杭州 网站定制
  • 做一个赚钱的网站好建设企业银行电脑版怎么下载
  • 制作旅游网站网页的代码aspcms 网站无法显示该页面
  • 盗网站asp源码免费crm网站下载
  • 个人做的网站可以收款响应式网站要怎么做
  • 深圳市门户网站建设建设网站一般多钱
  • 免费建站平台排行榜xampp如何搭建wordpress
  • cms适合做什么网站网站页面优化怎么做
  • 做网站和做软件哪个难下沙建设局网站
  • 网站建设+深圳+凡科湖南建设工程信息网站