当前位置: 首页 > news >正文

【FATE联邦学习debug】 No module named ‘federatedml‘

直接pip install federatedml是无法找得到这个库的。
这个的原因是环境变量的事情,因为在部署文档中,本身提示我们要更新一些环境变量,如果不export那些变量,下面的fate_test其实也是无法测试成功的。

在这里插入图片描述
打开bin/init_env.sh,其内容如下

#!/bin/bash#
#  Copyright 2019 The FATE Authors. All Rights Reserved.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#fate_project_base=$(cd `dirname "$(realpath "${BASH_SOURCE[0]:-${(%):-%x}}")"`; cd ../;pwd)
export FATE_PROJECT_BASE=$fate_project_base
export FATE_DEPLOY_BASE=$fate_project_base
export EGGROLL_HOME=
export PYTHONPATH=/root/Downloads/standalone_fate_install_1.10.0_release/fate/python:/root/Downloads/standalone_fate_install_1.10.0_release/fateflow/pythonexport FATE_LOG_LEVEL=DEBUG
export FATE_PROFILE_LOG_ENABLED=0
export EGGROLL_LOG_LEVEL=INFOvenv=/root/Downloads/standalone_fate_install_1.10.0_release/env/python/venv
export JAVA_HOME=/root/Downloads/standalone_fate_install_1.10.0_release/env/jdk/jdk-8u345
export PATH=$PATH:$JAVA_HOME/bin
source ${venv}/bin/activate

可以看到这个库本身在下载的FATE包里
在这里插入图片描述

那接下来其实可以给conda的python解释器添加环境变量,如何做?
先查看下当前的python解释器的路径echo $PATHecho $PYTHONPATH$,由于我使用的是conda虚拟环境,我就使用conda自带的虚拟环境的环境变量工具添加上init_env那两个路径就行了

init_env文件想export PYTHONPATH

export PYTHONPATH=/root/Downloads/standalone_fate_install_1.10.0_release/fate/python:/root/Downloads/standalone_fate_install_1.10.0_release/fateflow/python

那用conda的话就直接

conda-env config  vars set PYTHONPATH=/root/Downloads/standalone_fate_install_1.10.0_release/fate/python:/root/Downloads/standalone_fate_install_1.10.0_release/fateflow/python

输入后,提示To make your changes take effect please reactivate your environment
这样就可以了。

如果你不用conda,你也可以直接跟文件里的那样直接输入 export PYTHONPATH=/root/Downloads/standalone_fate_install_1.10.0_release/fate/python:/root/Downloads/standalone_fate_install_1.10.0_release/fateflow/python,应该也行,但是你的代码编辑器大概率还会报错,但是运行是可以运行的。

如果还想代码编辑器不报错,你可以找找你代码编辑器的关于编辑器环境变量的设置。

http://www.lryc.cn/news/32761.html

相关文章:

  • 【Git】P1 Git 基础
  • 智能交通数据集Rope3D(仅限科研使用)
  • Java虚拟机JVM-面试题
  • 详细的说说Redis的数据类型
  • 798.差分矩阵
  • InfluxDB 2 介绍与使用 flux查询 数据可视化
  • Qt QTreeView简单使用
  • Wannacrypt蠕虫老树开花?又见Wannacrypt
  • 结合基于规则和机器学习的方法构建强大的混合系统
  • Spring Security OAuth2实现多用户类型认证、刷新Token
  • 云计算介绍,让你更了解云计算
  • 阿里大佬翻遍全网Java面试文章,总结出这份1658页文档,GitHub收获25K+点赞
  • 【JDK1.8 新特性】Lambda表达式
  • 【Vue.js】Vuex核心概念
  • react router零基础使用教程
  • IOC三种依赖注入的方式,以及区别
  • Ubuntu18安装新版本PCL-1.13,并和ROS自带PCL-1.8共存
  • 计算机图形学08:中点BH算法绘制抛物线(100x = y^2)
  • 基于java的高校辅导员工作管理系统
  • 字节3次都没裁掉的7年老测试。掌握设计业务与技术方案,打开上升通道!
  • 详细介绍关于链表【数据结构】
  • 2.3 二分搜索技术
  • RWEQ模型的土壤风蚀模数估算、其变化归因分析
  • 学习streamlit-1
  • GPS定位知识介绍
  • 【Linux】理解Linux环境变量
  • ISCSI块存储-集群
  • 11.Maxwell 部署
  • 一文速学-GBDT模型算法原理以及实现+Python项目实战
  • 前端——2.HTML基本结构标签