I think I've a solution, but welcome comments about potential problems.
(Tested in a VirtualBox instance of Linux Mint Zara.)
I followed miniconda3 installation instructions. On restarting terminal after
installation, the venv for conda was active, i.e., the "(base) " prefix to the
terminal prompt was there.
I then added to .bashrc the 4 lines between the dashes
-------------------------------------------
# start with conda NOT running
conda deactivate
echo "To activate conda issue 'conda activate'"
-------------------------------------------
Now I can activate conda with the indicated command or
do 'conda deactivate' to get back to normal.
Is this sensible?
John Nash
On 2026-05-14 09:22, Nash JC - NCF via linux wrote:
I tried changing eval to source in my conda-init.sh script and
got the "(base) prompt>" CLI prompt from running the script, but needed to
manually put in conda deactivate to get back to plain prompt.
Then found new terminal had the conda setup pushed into .bashrc.
And now the script doesn't fire a second time.
Not sure at all what is going on, but will try again in a pretty
fresh VM to provide some fences, as I don't want to mess up working
machine. Clearly I'm missing some aspect of how the venv works, but
I'm wanting to avoid mixing dev and operational Python programs.
Cheers, JN
On 2026-05-13 18:48, Ron via linux wrote:
Nash JC - NCF via linux wrote on 2026-05-13 15:04:
eval "$__conda_setup"
I get things going and see the command prompt with prefix " (base) "
The command '
conda deactivate
returns to normal prompt.
However, putting these in scripts doesn't work. I suspect calling scripts is not getting right info to the virtual
environment.
This hints at the difference between sourcing and executing a script - shared environment is preserved when sourcing.
I suspect eval is doing something in a subshell?
What happens if you merely source the scripts instead of eval-ing them?
To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org
To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org