Python:3.10
pip: >= 19.3
OS: CentOS 7, Ubuntu 20.04
CPU/Memory: recommended minimum requirement is 8C16G.
Note: Due to CI resource limitation, macOS x64 prebuild binary is no longer available.
For users who want to try SecretFlow, you can install the current release.
Note that it requires python version == 3.10, you can create a virtual environment with conda if not satisfied.
conda create -n sf python=3.10
conda activate sf
After that, please use pip to install SecretFlow.
pip install -U sfl- Download code and set up Python virtual environment.
git clone https://github.com/secretflow/sfl.git
cd secretflow
conda create -n secretflow python=3.10
conda activate sfl- Install SFL
python -m build --wheel
pip install dist/*.whlSecretFlow does not support Windows directly now, however, a Windows user can use secretFlow by WSL(Windows Subsystem for Linux).
- Install WSL2 in Windows
- You are supposed to follow the guide_zh or guide_en to install WSL(Windows Subsystem for Linux) in your Windows and make sure that the version of WSL is 2.
- As for the distribution of GNU/Linux, Ubuntu is recommended.
- Install Anaconda in WSL
Just follow the installation of anaconda in GNU/Linux to install anaconda in your WSL.
- Install SFL
- create conda environment
conda create -n sf python=3.10- activate the environment
conda activate sf- use pip to install SFL.
pip install -U sfl
- Use WSL to develop your application
After set up of SecretFlow in WSL, you can use Pycharm Professional to Configure an interpreter using WSL or Visual Studio Code with WSL to use SecretFlow in Windows Operating System.
Try your first SecretFlow program.
Import secretflow package.
>>> import secretflow as sfCreate a local cluster with parties alice, bob and carol.
>>> sf.init(parties=['alice', 'bob', 'carol'], address='local')Create alice's PYU device, which can process alice's data.
>>> alice_device = sf.PYU('alice')Let alice say hello world.
>>> message_from_alice = alice_device(lambda x:x)("Hello World!")Print the message.
>>> message_from_alice
<secretflow.device.device.pyu.PYUObject object at 0x7fdec24a15b0>We see that the message on alice device is a PYU Object at deriver program.
Print the text at the driver by revealing the message.
>>> print(sf.reveal(message_from_alice))
Hello World!