rsnt_translations
56,420
edits
mNo edit summary |
No edit summary |
||
Line 22: | Line 22: | ||
<!--T:6--> | <!--T:6--> | ||
You can then load the version of your choice using < | You can then load the version of your choice using <code>module load</code>. For example, to load Python 3.10 you can use the command | ||
{{Command|module load python/3.10}} | {{Command|module load python/3.10}} | ||
Line 85: | Line 85: | ||
<!--T:9--> | <!--T:9--> | ||
To create a virtual environment, make sure you have selected a Python version with < | To create a virtual environment, make sure you have selected a Python version with <code>module load python</code> as shown above in section ''Loading a Python module''. If you expect to use any of the packages listed in section ''SciPy stack'' above, also run <code>module load scipy-stack</code>. Then enter the following command, where <code>ENV</code> is the name of the directory for your new environment: | ||
{{Command|virtualenv --no-download ENV}} | {{Command|virtualenv --no-download ENV}} | ||
Line 93: | Line 93: | ||
<!--T:44--> | <!--T:44--> | ||
You should also upgrade < | You should also upgrade <code>pip</code> in the environment: | ||
{{Command|pip install --no-index --upgrade pip}} | {{Command|pip install --no-index --upgrade pip}} | ||
<!--T:12--> | <!--T:12--> | ||
To exit the virtual environment, simply enter the command < | To exit the virtual environment, simply enter the command <code>deactivate</code>: | ||
{{Command|prompt=(ENV) [name@server ~]|deactivate}} | {{Command|prompt=(ENV) [name@server ~]|deactivate}} | ||
<!--T:71--> | <!--T:71--> | ||
You can now use the same virtual environment over and over again. Each time: | You can now use the same virtual environment over and over again. Each time: | ||
# Load the same environment modules that you loaded when you created the virtual environment, e.g. < | # Load the same environment modules that you loaded when you created the virtual environment, e.g. <code>module load python scipy-stack</code> | ||
# Activate the environment, < | # Activate the environment, <code>source ENV/bin/activate</code> | ||
=== Installing packages === <!--T:13--> | === Installing packages === <!--T:13--> | ||
Line 111: | Line 111: | ||
<!--T:15--> | <!--T:15--> | ||
All of < | All of <code>pip</code>'s commands are explained in detail in the [https://pip.pypa.io/en/stable/user_guide/ user guide]. We will cover only the most important commands and use the [http://numpy.scipy.org/ Numpy] package as an example. | ||
<!--T:16--> | <!--T:16--> | ||
Line 118: | Line 118: | ||
<!--T:18--> | <!--T:18--> | ||
We then activate the virtual environment, previously created using the < | We then activate the virtual environment, previously created using the <code>virtualenv</code> command: | ||
{{Command|source ENV/bin/activate}} | {{Command|source ENV/bin/activate}} | ||
Finally, we install the latest stable version of Numpy: | Finally, we install the latest stable version of Numpy: |