mlflow ui 启动报错No such file or directory: 'gunicorn': 'gunicorn'
1、mlflow ui 启动报错,信息如下:
[root@localhost mlflow]# mlflow ui /usr/local/python3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 return f(*args, **kwds) Traceback (most recent call last): File "/usr/bin/mlflow", line 11, in <module> sys.exit(cli()) File "/usr/local/python3/lib/python3.6/site-packages/click/core.py", line 722, in __call__ return self.main(*args, **kwargs) File "/usr/local/python3/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/local/python3/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/python3/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/python3/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(*args, **kwargs) File "/usr/local/python3/lib/python3.6/site-packages/mlflow/cli.py", line 138, in ui _run_server(file_store, file_store, host, port, 1, None) File "/usr/local/python3/lib/python3.6/site-packages/mlflow/server/__init__.py", line 62, in _run_server env=env_map, stream_output=True) File "/usr/local/python3/lib/python3.6/site-packages/mlflow/utils/process.py", line 34, in exec_cmd stdin=subprocess.PIPE, **kwargs) File "/usr/local/python3/lib/python3.6/subprocess.py", line 709, in __init__ restore_signals, start_new_session) File "/usr/local/python3/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'gunicorn': 'gunicorn'
2、原因:
mlflow启动时,会调用subprocess.PIPE创建子进程,子进程启动找不到gunicorn命令:
3、解决方法:
创建gunicorn软连接:
ln -s /usr/local/python3/bin/gunicorn /usr/bin/gunicorn
或者将
/usr/local/python3/bin添加到PATH,export PATH=${PATH}:/usr/local/python3/bin