Tools, FAQ, Tutorials:
Upgrade/Downgrade Python in Conda on nvidia/cuda Docker
How to Upgrade or Downgrade Python in Conda on nvidia/cuda Docker?
✍: FYIcenter.com
If you need to run a specific version of Python, you can
Upgrade or Downgrade Python Conda on nvidia/cuda Docker
as shown in this tutorial.
1. Attach a terminal to the running docker.
fyicenter# docker exec -it my_cuda /bin/bash (base) root@e4395c83ac54:/#
2. Install "pip" in the default Conda environment "base".
(base) root@e4395c83ac54:/# conda install -y -c conda-forge pip Downloading and Extracting Packages certifi-2021.5.30 | 141 KB | python_abi-3.9 | 4 KB | openssl-1.1.1k | 2.1 MB | wheel-0.37.0 | 31 KB | conda-4.10.3 | 3.1 MB | pip-21.2.4 | 1.1 MB | ca-certificates-2021 | 136 KB |
3. Install Python 3.7.
(base) root@e4395c83ac54:/# conda install -y -c conda-forge python=3.7 Downloading and Extracting Packages conda-package-handli | 921 KB | pycosat-0.6.3 | 107 KB | ruamel_yaml-0.15.80 | 270 KB | chardet-4.0.0 | 204 KB | cffi-1.14.6 | 225 KB | setuptools-49.6.0 | 947 KB | conda-4.10.3 | 3.1 MB | cryptography-3.4.7 | 1.1 MB | brotlipy-0.7.0 | 341 KB | certifi-2021.5.30 | 141 KB | python_abi-3.7 | 4 KB | pysocks-1.7.1 | 27 KB | python-3.7.10 | 57.3 MB |
4. Verify Python version inside Conda.
(base) root@e4395c83ac54:/# python --version Python 3.7.10
5. Verify Python version outside Conda.
(base) root@e4395c83ac54:/# conda deactivate root@e4395c83ac54:/# python --version bash: python: command not found
6. Create a new Conda environment with Python 3.9.
root@e4395c83ac54:/# conda create -n py3.9 environment location: /opt/conda/envs/py3.9 root@e4395c83ac54:/# conda activate py3.9 (py3.9) root@e4395c83ac54:/#
7. Upgrade the new Conda environment to Python 3.9.
(py3.9) root@e4395c83ac54:/# conda install -y -c conda-forge python=3.9 Downloading and Extracting Packages readline-8.1 | 295 KB | _libgcc_mutex-0.1 | 3 KB | sqlite-3.36.0 | 1.4 MB | libgcc-ng-11.1.0 | 908 KB | tk-8.6.10 | 3.2 MB | ncurses-6.2 | 985 KB | python-3.9.6 | 27.5 MB | xz-5.2.5 | 343 KB | zlib-1.2.11 | 106 KB | tzdata-2021a | 121 KB | _openmp_mutex-4.5 | 22 KB | ld_impl_linux-64-2.3 | 667 KB | libffi-3.3 | 51 KB | setuptools-49.6.0 | 943 KB | libgomp-11.1.0 | 427 KB | libstdcxx-ng-11.1.0 | 4.2 MB |
8. Verify Python version in both Conda environmwnts:
(py3.9) root@e4395c83ac54:/# python --version Python 3.9.6 (py3.9) root@e4395c83ac54:/# conda activate base (base) root@e4395c83ac54:/# python --version Python 3.7.10
⇒ Install CUDA Toolkit in Conda on nvidia/cuda Docker
⇐ Install Miniconda3 on nvidia/cuda Docker
2023-02-21, 548👍, 1💬
Popular Posts:
How to add a new operation to an API on the Publisher Dashboard of an Azure API Management Service? ...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How to use "link" command tool to link objet files? If you have object files previously compiled by ...
How to use "{{...}}" Liquid Codes in "set-body" Policy Statement? The "{{...}}" Liquid Codes in "set...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...