我是 Python 新手,并尝试按照本教程在我的 Mac 中安装 Airflow
虽然这两个命令工作正常:
$ airflow initdb
$ airflow webserver -p 8080
Run Code Online (Sandbox Code Playgroud)
调度器命令(airflow scheduler)抛出以下错误:
[2020-02-18 13:18:09,012] {scheduler_job.py:1382} ERROR - Exception when executing execute_helper Traceback (most recent call last):
File "/Users/mac/Workspace/airflow/airflow_venv/lib/python3.8/site-packages/airflow/jobs/scheduler_job.py", line 1380, in _execute
self._execute_helper()
File "/Users/mac/Workspace/airflow/airflow_venv/lib/python3.8/site-packages/airflow/jobs/scheduler_job.py", line 1413, in _execute_helper
self.processor_agent.start()
File "/Users/mac/Workspace/airflow/airflow_venv/lib/python3.8/site-packages/airflow/utils/dag_processing.py", line 554, in start
self._process.start()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File …Run Code Online (Sandbox Code Playgroud) 我的servlet中有以下代码
response.setContentType("image/gif");
String filepath = "PATH//TO//GIF.gif";
OutputStream out = response.getOutputStream();
File f = new File(filepath);
BufferedImage bi = ImageIO.read(f);
ImageIO.write(bi, "gif", out);
out.close();
Run Code Online (Sandbox Code Playgroud)
此代码只是返回图像的第一帧.
如何实现返回完整的GIF图像?