linux_python_tips
Differences
This shows you the differences between two versions of the page.
linux_python_tips [2019/08/08 17:37] – created ktm5j | linux_python_tips [2023/08/29 19:56] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Python Tips ====== | ||
+ | To use python on CS Linux servers, you will first need to load either the '' | ||
+ | |||
+ | Load python3.6 by running: | ||
+ | |||
+ | < | ||
+ | ktm5j@portal01 ~ $ module load python | ||
+ | ktm5j@portal01 ~ $ which python | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | You will not be able to use '' | ||
+ | |||
+ | ===== Virtualenvs ===== | ||
+ | |||
+ | If you need to install your own packages virtualenvs may be useful. | ||
+ | |||
+ | First load the python module and create the env: | ||
+ | < | ||
+ | ktm5j@portal01 ~/ | ||
+ | ktm5j@portal01 ~/ | ||
+ | Using base prefix '/ | ||
+ | New python executable in / | ||
+ | Also creating executable in / | ||
+ | Installing setuptools, pip, wheel...done. | ||
+ | </ | ||
+ | |||
+ | Next, unload the python module and source the env activation script: | ||
+ | |||
+ | < | ||
+ | ktm5j@portal01 ~/ | ||
+ | ktm5j@portal01 ~/ | ||
+ | (local-env) ktm5j@portal01 ~/ | ||
+ | ~/ | ||
+ | ~/ | ||
+ | </ | ||
+ | |||
+ | You are now able to install packages via pip: | ||
+ | |||
+ | < | ||
+ | (local-env) ktm5j@portal01 ~/ | ||
+ | Collecting fabric | ||
+ | Downloading https:// | ||
+ | | ||
+ | Collecting paramiko> | ||
+ | Using cached https:// | ||
+ | Collecting invoke< | ||
+ | ... | ||
+ | </ |
linux_python_tips.txt · Last modified: 2023/08/29 19:56 by 127.0.0.1