Print this article Edit this article

lmod commands not found

If you are using bash it is recommended you add the lines below to the top of ~/.bashrc :

if [ -f /etc/bashrc ]; then
   . /etc/bashrc
eli
f [ -f /etc/bash.bashrc ]; then
   . /etc/bash.bashrc
fi

You can determine if you are using bash by doing: 

echo "$SHELL"

 

You can also try the following:

 

If you get a "command not found" type of error when trying a command like module load matlab you might need to make sure the terminal/shell is a 'login' shell.

First, look at the top of the terminal/shell window.

If the Title of the window looks like this image then jump to the Konsole info

 

Title of terminal/shell window. In this case it is a Konsole terminal from the KDE desktop.

 

Otherwise, if it looks like this, start here.

Title of terminal/shell window. In this case, a "plain" terminal.

Under Edit-->Preferences there should be a choice to open the terminal/shell as a 'login' shell.

 

Terminal Preferences Menu with Command section highlighted in red

 

Now select "Run command a login shell"

 

Terminal Preferences window with Command select highlighted with a read rectangle and the "Run command as login shell" button is checked

 

Close that terminal and open a new one.

The lmod commands should now be properly sourced and available.

 

 

 

 

For the Konsole Terminal from the KDE desktop you need to do the following.

 

Clickin on the Settings menu item.

Click on Settings menu item

 

Click on Manage Profiles...

Red box highlighting the Manage Profiles menu item. A red arrow is pointing at the red box

 

If there is only 1 profile listed and it is marked as read only a new profile must be created.

Otherwise proceed to editing the Command field:

A red arrow is pointing towards a red box around a Profile named Default with Read only in square brackets behind that and default in parentheses behind that.

Click on the New button on the left side

A red arrow is pointing towards a red box around the New option on the left hand side of the window

This will create a new profile. Under the profile name check the box labeled Default profile

A red arrow is pointing towards a red box around a checked box with the name Default profile.

Add the "-l" flag /bin/bash. If you are using another shell like tcsh or zsh use the same flag. This will create a shell that is a "login shell".

A red arrow is pointing towards a red box around a text field named Command. The text is /bin/bash -l

 

Next, click the Apply button.

A red arrow is pointing towards a red box around the Apply button in the bottom left of the window

 

Click on the Ok button.

A red arrow is pointing towards a red box around the OK button in the bottom left of the window

 

Close that terminal and open a new one.

The lmod commands should now be properly sourced and available.

Last Modified: Aug 4, 2023 4:37 pm GMT-4
Created: Apr 3, 2020 11:27 am GMT-4 by admin
JumpURL: