Can’t execute `conda activate` from bash script

I am still new to Anaconda and I encountered this error

"Can't execute conda activate from bash script"

To resolve the issue was pretty fast. I took a look at https://github.com/conda/conda/issues/7980

source ~/anaconda3/etc/profile.d/conda.sh
conda activate my_env

 

Solving environment: failed with initial frozen solve. Retrying with flexible solve

When I was loading my anaconda-2020, I’ve received this error.

conda install -c conda-forge opencv

And I got this error

Solving environment: failed with initial frozen solve. Retrying with flexible solve....

There was this thread from github which was useful and it help a lot! https://github.com/conda/conda/issues/9367

Step 1: To resolve, Create an environment called opencv using

conda create -n opencv

Step 2: Activate it

conda activate opencv

Step 3: Install it again

conda install -c anaconda opencv

(which install opencv 3, but not the most recent 4. In order to create a second environment called opencv4. Use above code to create and activate and do a standard download:

conda install -c conda-forge opencv