This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:python:start [2020/06/22 17:08] agill [User Package installation with Anaconda] |
howto:python:start [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Python ====== | ====== Python ====== | ||
| - | There are a number of python versions installed on Lengau compiled with either gcc or the intel compiler, including python 2.7.11 to 2.7.15, python 3.5-3.7 and anaconda installs for python 2 and 3. | + | See the [[guide:python|Python |
| - | Use this command to get a full list: | + | |
| - | module avail chpc/python | + | |
| - | + | ||
| - | All python modules should have mpi4py, numpy and scipy installed; however if matplotlib is required, please use anaconda (which also has the biggest range of 3rd-party python modules). The module chpc/ | + | |
| - | + | ||
| - | To use tensorflow, the anaconda module for python3 is also recommended. | + | |
| - | + | ||
| - | ==== User Package installation with Anaconda === | + | |
| - | Modules for anaconda version 2 and 3 are installed on lengau.To load these modules, use the following command (either from the command-line in an interactive session, or in a script: | + | |
| - | module add chpc/ | + | |
| - | or: | + | |
| - | module add chpc/ | + | |
| - | + | ||
| - | Using virtualenv with anaconda is not recommended. | + | |
| - | However, Anaconda does include a similar functionality, | + | |
| - | + | ||
| - | The following instructions to set up your virtual environment. **YOU NEED ONLY DO THEM ONCE. Please replace USERNAME with your actual username wherever it occurs below.** | + | |
| - | + | ||
| - | 1. log into lengau.chpc.ac.za | + | |
| - | + | ||
| - | 2. '' | + | |
| - | //Unlike the compute nodes, chpcviz1 and chpclic1 have a connection to the internet, which is needed here// | + | |
| - | + | ||
| - | 3. '' | + | |
| - | + | ||
| - | //you can substitute chpc/ | + | |
| - | + | ||
| - | 4. '' | + | |
| - | + | ||
| - | 5. '' | + | |
| - | + | ||
| - | // change python=3.6 to python=2.7 if you're using anaconda/ | + | |
| - | + | ||
| - | 6. '' | + | |
| - | + | ||
| - | //You don't have to use " | + | |
| - | + | ||
| - | 7. You can now install whatever packages you need, that are not installed already for instance, for rpy2, type: | + | |
| - | + | ||
| - | conda install rpy2 | + | |
| - | + | ||
| - | 8. you can now type: | + | |
| - | conda deactivate / | + | |
| - | to exit the virtual environment. | + | |
| - | + | ||
| - | + | ||
| - | Now, once you've done this, you can log out, and ready your job for submission from the login node. | + | |
| - | **You must do the following in your job-submit script**: | + | |
| - | Put it all near the top of your script, but after the #PBS directives: | + | |
| - | + | ||
| - | module add chpc/ | + | |
| - | + | ||
| - | conda activate / | + | |
| - | + | ||
| - | and at the end: | + | |
| - | conda deactivate / | + | |
| - | + | ||
| - | Then submit your script as normal with qsub. | + | |
| - | + | ||
| - | + | ||
| - | if you ever need to install new python packages, just repeat steps 1, 2, 3, 6, 7 and 8 from above. (omit 4 and 5). | + | |
| - | + | ||
| - | + | ||
| - | + | ||