Skip to content

1. Set up your environment


Complementary video available!
It provides a step-by-step guide to the initial setup.


1.1. Enter into your account via hss

Open Windows Subsystem for Linux WSL and log into your account using your username.

Note: Make sure to replace bastudil with your own username

ssh bastudil@login.sherlock.stanford.edu

Log into a computing node.

sdev

1.2. Install a New Environment

Use the following commands to create a new python environment.

Load the module in the system. See more pre-installed software here

module load python/3.9

Create the python environment

python3 -m venv mypyenv

Activate the environment

# source /path/to/my/opensees/bin/activate
source "/home/users/bastudil/mypyenv/bin/activate"

Check python version

python3 --version

Run an interactive python session. You will notice that the some python packages are not installed; you will need to install what you need.

python3

Exit python

# you are in python
exit()

Deactivate environment

deactivate

Exit the computing node

exit

1.3. Install Packages Needed to Run OpenSees and Tools

Go into your python environment and install the packages you need.

python3 -m pip install --upgrade matplotlib pandas numpy
python3 -m pip install --upgrade openseespy

You can see the version of the packages

# in the command line
pip show numpy
or
# in the python session
import numpy
print(numpy.__version__)


1.4. [optional] Avoiding multiple duo prompts when you log using WSL

You can set up your account to avoid multiple dup prompts; see more information here.

Paste this in "\\wsl.localhost\Ubuntu\home\bastudil_linux\.ssh\config"

Host login.sherlock.stanford.edu
    ControlMaster auto
    ControlPath ~/.ssh/%l%r@%h:%p

1.5. Commands that did not work for me

If you encounter the following error, there was no need to update Conda or Anaconda:

# Don't do this (wasn't needed)
conda update conda
conda update anaconda

Install a new environment. Using conda (Not working)

Error: libstdc++.so.6: version `GLIBCXX_3.4.21' not found

module load anaconda
#conda create -p /path/to/myenv conda pip setuptools
conda create --name <env_name> python=3.8
source /path/to/my/opensees/bin/activate
which python3
python3 -m pip install openseespy
python3 
>>> import openseespy.opensees as ops

Another option to install the virtual environment could be

python3.9 -m venv mypy39