skip to Main Content

I am using environment modules on my Ubuntu container. https://modules.readthedocs.io

When I call the following command: module av It shows me this kind of output:

> module av
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- /project/mb/modulefiles --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
meco/bamtools/2.4.1  meco/bbmap/39.00      meco/bedtools/2.23.0  meco/bhtsne/1.0     meco/bwa/0.7.17  meco/diamond/2.1.6  meco/fastani/1.33   meco/fasttree/2.1.10  meco/hmmer/3.3.2  meco/mafft/7.471          meco/meco_tools/1.3.3  meco/metabat/2.12.1  meco/perl/5.38.0  meco/prodigal/2.6.3  meco/python/3.11.3  meco/R/4.3.1             meco/rtk/0.93.2    meco/SPAdes/3.15.0      meco/trimmomatic/0.39  meco/zlib/1.2.8  
meco/barrnap/0.9     meco/bedtools/2.22.1  meco/bedtools/2.29.2  meco/bowtie2/2.4.1  meco/CAT/5.2.3   meco/dnaclust/3     meco/fastqc/0.11.4  meco/fastx/0.0.13.2   meco/lftp/4.8.3   meco/meco_pipeline/1.3.3  meco/megahit/1.2.9     meco/muscle/3.8.31   meco/pplacer/1.1  meco/pTrimmer/1.3.4  meco/quast/5.2.0    meco/rdp_classifier/2.8  meco/samtools/1.9  meco/sratoolkit/2.10.9  meco/vsearch/2.7.1     

However, if I run bash -c 'module av' it does not work:

# bash -c 'module av'
bash -c 'module av'
bash: line 1: module: command not found

From the faq, https://modules.readthedocs.io/en/latest/FAQ.html
the module command is actually a bash function.

Edit:
How can I make the bash -c 'module av' command show the same output as module av?

Please, help would be appreciated.

2

Answers


  1. Chosen as BEST ANSWER

    I've finally opted to install and use Lmod instead of Environment modules. It now works. Although I still do not understand the root nature of the problem I had in my question. Cheers,


  2. The bash: line 1: module: command not found error is due to the bash session not being aware of the module shell function. It means that the initialization process of your bash -c command does not go through an initialization shell script that defines the module shell function.

    This error is either due to a packaging bug on the OS you use (environment-modules on Ubuntu) or to some specific configuration you may have set.

    To solve this issue, you may either:

    • ensure the module shell function is correctly defined by sourcing its definition script:
    $ bash -c '. /usr/share/modules/init/bash; module av'
    
    • directly call the script behind the module shell function:
    $ bash -c '/usr/lib/modulecmd.tcl bash av'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search