PYFLINK 基础 (四):运行相关(四)PYFLINK 依赖管理


依赖管理

  1. 依赖文件
table_env.add_python_file(file_path)
  1. 依赖存档(打包)文件
table_env.add_python_archive("py_env.zip", "myenv") 
# the files contained in the archive file can be accessed in UDF 
def my_udf(): 
       with open("myenv/py_env/data/data.txt") as f: 
  1. 依赖第三方项目
# commands executed in shell 
echo numpy==1.16.5 > requirements.txt 
pip download -d cached_dir -r requirements.txt --no-binary :all: 
# python code 
table_env.set_python_requirements("requirements.txt", "cached_dir")
  1. 指定Python Interpreter路径
table_env.get_config().set_python_executable("py_env.zip/py_env/bin/python")

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM