Now I have a project and I think it can be divided into three different modules like below.
project │ README.md │ └───flask_web │ └───app_folder │ | └─── ... | | └─── ... | | | __init__.py | | │ │ app_run.py │ └───venv │ └──bin | │ └───Fate | └─── ... | └───env | └───python36 | └───venv | └───bin | └───fake_data_algorithm └─── ... └───venv └───bin
The first part ‘web’ is a flask application providing web service, it requires a virtual environment.
The second part ‘fate’ is a open source project for federal learning and also needs a virtual environment.If I want to start the system for federal learning process, I have to source ‘fate/bin/init_env.sh’ to activate the providing environment.
The third part ‘fake_data_algorithm’ is used to generate fake data based on the ‘data’ folder, which also requires virtual env for some python packages.
Because the after the ‘web’ application getting the request from browser, it will call
‘fate’ or ‘fake_data_algorithm’, but both of them are in a different virtual environment, so I should source the environment again.
so my puzzle is: Is there a mechanism that can enable the whole project keep running without switching the virtual environment.And because the “fate” is a relatively close part, I want to keep the virtual environment of ‘fate’ as far as possible(try to avoid put all the python packages in a single environment).



