Preserve PATH when using sudo

This commit is contained in:
GeorgianaElena
2020-01-30 19:53:58 +02:00
parent e6d340eb44
commit 1cc29df1fd

View File

@@ -179,31 +179,31 @@ To upgrade the Python version of the user environment, one can:
1. Activate the user environment, if using ssh. 1. Activate the user environment, if using ssh.
If the terminal was started with JupyterHub, this step can be skipped: If the terminal was started with JupyterHub, this step can be skipped:
.. code-block:: console .. code-block:: bash
source /opt/tljh/user/bin/activate source /opt/tljh/user/bin/activate
2. Get the list of currently installed pip packages (so you can later install them under the 2. Get the list of currently installed pip packages (so you can later install them under the
new Python): new Python):
.. code-block:: console .. code-block:: bash
pip freeze > pip_pkgs.txt pip freeze > pip_pkgs.txt
3. Update all conda installed packages in the environment: 3. Update all conda installed packages in the environment:
.. code-block:: console .. code-block:: bash
sudo conda update --all sudo PATH=${PATH} conda update --all
4. Update Python version: 4. Update Python version:
.. code-block:: console .. code-block:: bash
conda install python=3.7 sudo PATH=${PATH} conda install python=3.7
5. Install the pip packages previously saved: 5. Install the pip packages previously saved:
.. code-block:: console .. code-block:: bash
pip install pip_pkgs.txt pip install pip_pkgs.txt