Command works in Terminal, but not in

Hi, I’ve been working on this bug for over 5 hours and I’m not sure how to solve it. I have a Python script which I use to setup an Anaconda environment and one of the libraries in that environment which needs to be setup, has to be compiled.

In the Terminal, there is no problem. g++11 is needed to compile so I simply run conda install -y gxx_linux-64=11.2.0 and then the compilation script python The compile completes successfully and everything is setup.

With however, the install completes, but the subsequent compilation script says it is unable to compile because it can’t find g++11.

Here is my call to"conda install -y gxx_linux-64=11.2.0; python", shell=True)

I figured it out. Even though I was able to use conda, I was never in a conda environment. Conda does not support subshells so every time a new subshell is created, the conda environment has to be activated in order to be in the environment. Finally!

This is how it looks now:"conda install -y gxx_linux-64=11.2.0", shell=True)". <conda path>/etc/profile.d/ && conda activate <conda env> && python", shell=True)