1.创建文件夹
mkdir mlwork
cd mlwork
2. 创建一个干净的venv环境
[hdfs@xydwtest01 ~/mlwork]$ source ~/miniconda3/bin/activate
(root) [hdfs@xydwtest01 ~/mlwork]$ virtualenv
-bash: virtualenv: command not found
没有找到 virtualenv,需要安装virtualenv
pip install virtualenv
virtualenv安装成功,继续
(root) [hdfs@xydwtest01 ~/mlwork]$ virtualenv --no-site-packages venv
Using base prefix '/home/hdfs/miniconda3'
New python executable in /home/hdfs/mlwork/venv/bin/python
/home/hdfs/mlwork/venv/bin/python: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
ERROR: The executable /home/hdfs/mlwork/venv/bin/python is not functioning
ERROR: It thinks sys.prefix is '/home/hdfs/mlwork' (should be '/home/hdfs/mlwork/venv')
ERROR: virtualenv is not compatible with this system or executable
错误:/home/hdfs/mlwork/venv/bin/python: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
原因:python运行时没有加载到libpython3.6m.so.1.0 这个库文件,将其复制到响应目录OK,输入下列命令即可
cp ~/miniconda3/lib/libpython3.6m.so.1.0 /usr/lib64/
3.安装mlflow、sklearn等包
(venv) (root) [hdfs@xydwtest01 ~/mlwork]$ pip install mlflow
Looking in indexes: https://pypi.doubanio.com/simple/
安装sklearn时出问题
(venv) (root) [hdfs@xydwtest01 ~/mlwork]$ pip install sklearn
Looking in indexes: https://pypi.doubanio.com/simple/
ERROR: Could not install packages due to an EnvironmentError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',))
解决方案:换个镜像源
(venv) (root) [hdfs@xydwtest01 ~/mlwork]$ pip install sklearn -i https://pypi.tuna.tsinghua.edu.cn/simple/
4.启动
mlflow ui
来源:CSDN
作者:L13763338360
链接:https://blog.csdn.net/L13763338360/article/details/103703944