Exporting conda environments without using conda commands

17 Views Asked by At

I'm recovering data from a broken Ubuntu installation (using the try mode of an Ubuntu iso from a live USB) and I need to recover some conda environments, but since I'm in try mode, anaconda isn't installed so I cannot use conda commands to export this environments. Anyone knows a work around to this? Thanks!!

I tried copying the environments directly into an USB drive but its filesystem does not support symbolic links. Thanks again for any help

1

There are 1 best solutions below

0
James On

What you need to pull out is the conda history files for the environments you want to save. It is a history of the actions taken by conda in the creation and modification of that environment.

In Conda on Linux, look for the file:

<conda env root>/conda-meta/history

It will have a format such as:

==> 2023-10-26 14:34:46 <==
# cmd: /path/to/conda-script.py install ruff -c conda-forge
# conda version: 23.5.2
-defaults/win-64::ca-certificates-2023.08.22-haa95532_0
-defaults/win-64::certifi-2023.7.22-py311haa95532_0
-defaults/win-64::openssl-3.0.11-h2bbff1b_2
+conda-forge/noarch::certifi-2023.7.22-pyhd8ed1ab_0
+conda-forge/win-64::ca-certificates-2023.7.22-h56e8100_0
+conda-forge/win-64::openssl-3.1.4-hcfcfb64_0
+conda-forge/win-64::ruff-0.1.2-py311hc14472d_0
# update specs: ['ruff']
==> 2023-11-07 09:14:29 <==
# cmd: /path/to/conda-script.py install click
# conda version: 23.5.2
-conda-forge/noarch::certifi-2023.7.22-pyhd8ed1ab_0
-conda-forge/win-64::ca-certificates-2023.7.22-h56e8100_0
-conda-forge/win-64::openssl-3.1.4-hcfcfb64_0
+defaults/win-64::ca-certificates-2023.08.22-haa95532_0
+defaults/win-64::certifi-2023.7.22-py311haa95532_0
+defaults/win-64::click-8.1.7-py311haa95532_0
+defaults/win-64::openssl-3.0.12-h2bbff1b_0
# update specs: ['click']