in several repositories I’ve seen such environment managing logic: initial setup.sh
installs miniconda inside project folder and creates environment there. In code it looks like:
installer=Miniconda3-py38_4.8.3-Linux-x86_64.sh
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 20 https://repo.anaconda.com/miniconda/$installer
bash $installer -b -p anaconda/
So after that setup.sh
activates env, installs pip and installs all packages, something like that:
source anaconda/bin/activate
conda install -y pip
pip install --index-url "url_with_local_modules" -r requirements.txt
After that, each time you work on that project, you activate env by just typing source anaconda/bin/activate
.
My question one is: what’s the benefit of such setup? These repositories are run on cluster with many users, so I suppose that allows to move all conda related files from /usr folder to project folder, saving space and making managing projects easier? Any other reasons you can see, since for me setup looks really similar to venv but with conda for some unknown reason.
Question two: how do I do the same on windows? I’m used to just using anaconda to create envs, so I’m not sure how do I put whole conda + env into project folder, so I can activate it just from the project itself by directly using activate
file. Also, source
won’t work on windows, right? I’ll have to use different command?