Alienv not working

Hi everyone,

I am trying to use O2 software on MacOS Catalina 10.15.6 and I have several builds installed. All worked for me before, but now when I tried to use command ‘alienv enter O2/latest-dev-o2’ (or any other tag), I get an error message ’ ERROR: O2/latest-dev-o2 was not found’. Also, when I try to enter ‘alienv q’, it is not finding anything. However, I can see all the builds in ‘~/alice/sw/BUILD/’. Could anyone help me with this?

Thanks in advance,


I have seen that in the past. It seems that something gets corrupted out of nowhere and then alienv does not see any of the previously built software.

The only way out of it I found was to delete sw which is not good.

Hopefully someone has a better solution.


Did a build fail to complete? If that is the case, the link might be indeed missing.

I have managed to solve this issue yesterday.
It turns out that alienv q uses brew -t avail to list all installed modules.
Next, it pipes stderr to stdout, so instead of crashing, it just pipes the error message to the next step (this will become important later).
This masked the underlying problem, which was caused by modulecmd which is used to access all available O2 packages.
For some reason, I assume during migration from v3 to v4, as per commit, the command is expected to be modulecmd-compat.
Presumably, in my case, easy_install pip updates Homebrew as well, which regenerated files in libexec directory, where modulecmd-compat used to reside, and was removed after the update.
This causes modulecmd to fail via the file simply not existing.
Since stderr is being piped to stdout and not treated as a proper error, grep down the pipeline can’t find anything that would resemble O2 modules, and simply prints nothing, thus hiding the real error.

A quick patch for this was to create a symlink named modulecmd-compat targeting /usr/local/Cellar/modules/4.6.0/libexec/modulecmd.tcl in the same location as modulecmd.tcl.

1 Like

This looks like a botched alienv migration to module4… :-/ I think now we are modules4 safe (and if not, we should fix the modules). Can you try dropping completely the reference to module-compat in alienv and see if that works?

I got the same error today, and the solution proposed by @dkrupova worked perfectly for me:

$ alienv enter O2/latest
ERROR: O2/latest was not found 
$ ln -s /usr/local/Cellar/modules/4.6.0/libexec/modulecmd.tcl /usr/local/Cellar/modules/4.6.0/libexec/modulecmd-compat
$ alienv enter O2/latest
Loading O2/latest
  Loading requirement: BASE/1.0 fmt/6.1.2-1 FairLogger/v1.9.0-1 boost/v1.74.0-1 asiofi/v0.3.1-1 FairMQ/v1.4.25-1 AliEn-Runtime/v2-19-le-1 Python-modules/1.0-1 XRootD/v4.11.1-1
    protobuf/v3.12.3-1 utf8proc/v2.5.0-1 Clang/v10.0.1-1 arrow/v1.0.0-1 ROOT/v6-20-02-alice7-1 GEANT3/v3-5-1 GEANT4/v10.5.1-1 vgm/v4-7-1 GEANT4_VMC/v5-0-p5-1 pythia6/428-alice1-1
    lhapdf/v6.2.1-alice2-1 pythia/v8302-1 FairRoot/v18.4.1-1 Vc/1.4.1-1 HepMC3/3.2.2-1 ApMon-CPP/v2.2.8-alice5-1 Monitoring/v3.3.5-1 Ppconsul/0.1.0-1 Configuration/v2.2.6-1
    libInfoLogger/v1.3.14-1 Common-O2/v1.4.9-1 ms_gsl/2.1.0-1 GLFW/3.3.2-1 DebugGUI/v0.2.0-1 xjalienfs/1.2.5-1 JAliEn-ROOT/0.6.2-1 cgal/4.12.2-1 fastjet/v3.3.3_1.042-alice1-1
    AEGIS/v1.2-1 libjalienO2/0.1.2-1
Currently Loaded Modulefiles:
 1) BASE/1.0                   9) XRootD/v4.11.1-1        17) vgm/v4-7-1              25) ApMon-CPP/v2.2.8-alice5-1  33) DebugGUI/v0.2.0-1              
 2) fmt/6.1.2-1               10) protobuf/v3.12.3-1      18) GEANT4_VMC/v5-0-p5-1    26) Monitoring/v3.3.5-1        34) xjalienfs/1.2.5-1              
 3) FairLogger/v1.9.0-1       11) utf8proc/v2.5.0-1       19) pythia6/428-alice1-1    27) Ppconsul/0.1.0-1           35) JAliEn-ROOT/0.6.2-1            
 4) boost/v1.74.0-1           12) Clang/v10.0.1-1         20) lhapdf/v6.2.1-alice2-1  28) Configuration/v2.2.6-1     36) cgal/4.12.2-1                  
 5) asiofi/v0.3.1-1           13) arrow/v1.0.0-1          21) pythia/v8302-1          29) libInfoLogger/v1.3.14-1    37) fastjet/v3.3.3_1.042-alice1-1  
 6) FairMQ/v1.4.25-1          14) ROOT/v6-20-02-alice7-1  22) FairRoot/v18.4.1-1      30) Common-O2/v1.4.9-1         38) AEGIS/v1.2-1                   
 7) AliEn-Runtime/v2-19-le-1  15) GEANT3/v3-5-1           23) Vc/1.4.1-1              31) ms_gsl/2.1.0-1             39) libjalienO2/0.1.2-1            
 8) Python-modules/1.0-1      16) GEANT4/v10.5.1-1        24) HepMC3/3.2.2-1          32) GLFW/3.3.2-1               40) O2/latest                      
Use alienv list to list loaded modules. Use exit to exit this environment.

I have just posted my solution to this problem, that was to reinstall modules 4.5.3 (the latest version 4.6.0 has different behaviour and the modulecmd bash -t avail does not produce the expected output):

brew unlink modules
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/
git log modules.rb
git checkout cc32eb129cf86765deb6ff39b26ccadd794e197a modules.rb
brew install modules
git checkout – modules.rb
git reset --hard
brew switch modules 4.5.3

Dear all,
can’t update alienv instead of downgrading modules?
I’ve checked that if I comment out:
inside alienv, it works without any further error.
But of course I did not try if this breaks some other systems.


In fact, there is a pull request that works for both versions of modules (4.5.3 and 4.6.0), which is exactly what you propose. I was not aware of it: