Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Column
width900px


Code Block
languagebash
themeDJango
titleTerminal 4: Pip install from requirements
$ module load python/3.9.7
$ module load py-pip/21.1.2-py3.9.7

$ module load py-numpy/1.20.3

$ sg <projectcode> -c 'pip install --user --no-deps -r requirements.txt'
Collecting astropy==4.1 (from -r requirements.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/74/9c/a1e51955d4a2af497a507c323409ebe55c122a91c438d2884d918360efc1/astropy-4.1-cp36-cp36m-manylinux1_x86_64.whl (10.3MB)
     |████████████████████████████████| 10.3MB 16.0MB/s 
Requirement already satisfied: numpy==1.19.0 in /pawsey/sles12sp3/python/3.6.3/numpy/1.19.0/lib/python3.6/site-packages/numpy-1.19.0-py3.6-linux-x86_64.egg (from -r requirements.txt (line 2)) (1.19.0)
Installing collected packages: astropy
Successfully installed astropy-4.1


...

Column
width900px


Code Block
languagebash
themeDJango
titleTerminal 5. Using setuptools to install a Python package.
$ sg <projectcode> -c 'python setup.py build'
running build
running build_py
creating build
[...]
$ sg <projectcode> -c 'python setup.py install --user'
running install
running bdist_egg
running egg_info
[...]
Finished processing dependencies for tqdm==4.61.1


...

Column
width900px


Code Block
languagebash
themeDJango
titleTerminal 6: Create and then activate a virtual environment
$ python -m venv $MYGROUP/python-venv # create a virtual environment 
$ source $MYGROUP/python-venv/bin/activate # activate the environment, updating python paths 
$ sg <projectcode> -c 'pip install astropy==4.1' # install astropy in the environment 
$ deactivate # deactivate the environment, now cannot load packages installed in venv. 


...