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