'Can multiple scripts activate same conda environment in parallel?
Our host supports python 2, however python3 can be run by activating a conda environment. We were planning to migrate our scripts from python2 to python3.
The problem is that we may be running 10s of scripts at the same time (in parallel), and would like to confirm if its possible to ensure that there wouldn't be any problems.
I checked this, it says that sometimes the %RANDOM% may be same, resulting in failure, since it is only of 15 bits.
tldr; Is it possible to ensure conda activate works safely, and if yes what special handling would it require?
Solution 1:[1]
The problem you mention about %RANDOM% seems to have been fixed a few years ago: https://github.com/conda/conda/pull/9477. We cannot guarantee that everything will work, but I see no reason why it wouldn't. Even if conda activate doesn't work for you, you can use Conda without conda activate by simply setting the CONDA_PREFIX environment variable to the directory containing your desired Conda environment, and adding the bin subdirectory to your PATH. I do this regularly in places where running conda activate is not practical (e.g. because there is no shell).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | John Zwinck |
