Galaxy not using the newly created environment for tool execution.

I’m running a local galaxy installation, on a new computer running Ubuntu 20.04.
I have written some tools and uploaded them using planemo. This is an example of the simplest tool:

<tool id="Toy" name="Toy app" version="0.1.0">
    <requirement type="package" version="3.7.6">python</requirement>
    <requirement type="package">seaborn</requirement>

<command detect_errors="exit_code"><![CDATA[
    python $__tool_directory__/ '$argument' > '$output'
    <param type="data" name="argument" label="test argument" format="txt" />
    <data name="output" format="txt" label="${} on ${on_string}: Toy output"/>
    No help
    <citation type="bibtex">

As you can see, seaborn is required. When I proceed to install this tool in my local galaxy, it successfully creates a “mulled” conda environment containing all the needed dependencies. If activated manually, the environment works ok.

When I launch the tool using the galaxy interface, it ends up in error saying “No module named seaborn”.
I investigated a little more by stopping a job in the middle and looking inside the job folder, where I can find which contains the main commands (environment activation and script execution) and that wraps the latter.
When executed manually from a bash console, this happens:

  • If I execute alone, it works. It uses the python inside the mulled environment, all dependencies are met. Output is produced.
  • If I execute, it gives me the infamous “ModuleNotFound error” described above. And for a good reason: it uses galaxy/.venv/bin/python, which of course doesn’t have seaborn installed.

So the wrapper somehow ignores the correct environment and reverts to the standard python. Is there a reason for this, and a way to correct this behaviour?

Link to here
Link to here

Ok solved. It was because I was running galaxy from the base environment of my system-installed conda.
Still don’t really get the real reason, but if I deactivate everything and run galaxy from base bash, everything works.