At ESRF Jupyter-Slurm, installing libraries directly into the environment can be challenging due to restrictions. However, you can bypass these limitations by creating a virtual environment and connecting it to Jupyter-Slurm. This guide will walk you through the necessary steps to set up and configure your virtual environment for seamless integration.
- Ensure you have Python 3 installed on your system.
- Access to ESRF Jupyter-Slurm.
To create a virtual environment, use the following command:
python3 -m venv your_venv_name
Replace your_venv_name
with a name of your choice for the virtual environment.
Activate your newly created virtual environment. The activation command varies depending on your operating system:
- Linux:
source path_of_your_venv/your_venv_name/bin/activate
Once the virtual environment is activated, you can install the required libraries using pip
. For example:
pip3 install numpy pandas matplotlib
After installing the necessary libraries, you need to connect your virtual environment to Jupyter-Slurm. This is done by installing the ipykernel
package and creating a new kernel:
pip install ipykernel
python -m ipykernel install --user --name your_venv_name
Replace your_venv_name
with the name you chose for your virtual environment.
- Open Jupyter Notebook through Jupyter-Slurm.
- Go to the "Kernel" menu and select "Change kernel".
- Choose the kernel named "your_venv_name" that you created in the previous step.
By following these steps, you can successfully create a virtual environment and connect it to Jupyter-Slurm, allowing you to install and use the required libraries without any restrictions. This setup ensures a flexible and efficient working environment for your projects at ESRF.
If you encounter any issues or need further assistance, please feel free to open an issue on this repository.