User Tools

Site Tools


hpc:applications_and_libraries

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hpc:applications_and_libraries [2025/04/24 09:03] – [RStudio] Yann Sagonhpc:applications_and_libraries [2025/11/04 09:48] (current) – [Custom Python lib] Yann Sagon
Line 1091: Line 1091:
 ==== Custom Python lib ==== ==== Custom Python lib ====
  
-If you need to install a python library or a different version of the ones already installed, virtualenv is the solution.+If you need to install a Python library or a different version of the ones already installed, **virtualenv** is the solution.
  
-Python-virtualenv is installed on Baobab http://www.virtualenv.org/en/latest/+Python-virtualenv is installed on Baobabhttp://www.virtualenv.org/en/latest/
  
-Begin by loading a version of python using module (see above)+Begin by loading a version of Python using the module system (see above).
  
-Create a new virtualenv if it's not already existing (put it where you want and name it like you want):+Before creating your virtual environment, load the required modules.   
 +You must load **Python** and any additional Python packages you need (for example, SciPy-bundle):
  
-For ''virtualenv'' 20 or above (starting from ''Python/3.8.2'' ): <code console> +<code> 
-capello@login2:~$ virtualenv ~/baobab_python_env+ml GCC/14.3.0 Python/3.11.virtualenv/20.32.0 SciPy-bundle/2025.07
 </code> </code>
  
-For previous ''virtualenv'' versions: <code console+Create a new virtual environment (you can choose the location and name).   
-capello@login2:~$ virtualenv --no-site-packages ~/baobab_python_env+<WRAP center round tip 60%> 
 +It is recommended to use the option ''<nowiki>--system-site-packages</nowiki>'' so that you can benefit from the Python modules provided by the loaded modules. 
 +</WRAP> 
 + 
 +<code> 
 +virtualenv --system-site-packages ~/baobab_python_env
 </code> </code>
  
-This will create a directory named baobab_python_env in your home directory.+This will create a directory named **baobab_python_env** in your home directory.
  
-Every time you want to use your virtualenv, you should activate it first:+Every time you want to use your virtual environment, you should activate it first:
  
 <code> <code>
 . ~/baobab_python_env/bin/activate . ~/baobab_python_env/bin/activate
 </code> </code>
 +
 +<WRAP center round important 60%>
 +Before reusing this virtual environment, you must reload the same modules you used when creating it (e.g., Python and SciPy-bundle). Otherwise, some packages may not be available.
 +</WRAP>
 +
  
 Install all the needed packages in the environment: Install all the needed packages in the environment:
Line 1126: Line 1137:
 ~/baobab_python_env/bin/python ~/baobab_python_env/bin/python
 </code> </code>
- 
 ==== Pip install from source ==== ==== Pip install from source ====
 By default when you use ''pip'' to install a library, it will download a binary of ''.whl'' file instead of building the module from source. This may be an issue if the module itself depend on a custom ''libc'' version or is optimized for a given kind of CPU. In this case, you can force ''pip'' to install a module by building it from source. By default when you use ''pip'' to install a library, it will download a binary of ''.whl'' file instead of building the module from source. This may be an issue if the module itself depend on a custom ''libc'' version or is optimized for a given kind of CPU. In this case, you can force ''pip'' to install a module by building it from source.
hpc/applications_and_libraries.1745485426.txt.gz · Last modified: (external edit)