# Cache conda packages for offline installation Installing conda packages on a computer without internet is somewhat challenging. One common approach is to `conda-pack` your environment, transfer the pack, then "unpack" it on the other computer - [link](https://hackmd.io/@pmitev/Python_Bianca#Using-conda). Here is an alternative way, perhaps easier, to achieve "clean" conda environment installation. Start with the computer on which you have already installed the environment or you can install it. 1. On **source** (your or other working computer with the same processor architecture as the target) ```bash # export the list of packages explicitly so you can download the files $(base) conda list -n my_env --explicit > packages.wget # Download the necessary packages $ mkdir -p pkgs && cd pkgs $ wget -i ../packages.wget ``` 2. Edit `packages.wget` to point to the local package copies. ```bash awk -F '/' '/^http/ {print "pkgs/"$NF; next} {print} ' packages.wget > my_env-local.yaml ``` The awk script above will convert the `http://...` lines in `packages.wget` to `pkgs/...` i.e. ```bash # From https://repo.anaconda.com/pkgs/main/linux-64/sqlite-3.39.3-h5082296_0.conda # to pkgs/sqlite-3.39.3-h5082296_0.conda ``` 3. Transfer the content of the `pkgs` folder to the **target** machine. 4. On the **target** machine - create and install the environment. ```bash # From the folder that contains `pkgs` $(base) conda create -n my_env --file my_env-local.yaml --offline ``` ## Contacts: - [Pavlin Mitev](https://katalog.uu.se/profile/?id=N3-1425) - [UPPMAX](https://www.uppmax.uu.se/) - [SNIC AE@UPPMAX - related documentation](/8sqXISVRRquPDSw9o1DizQ) ![](https://snic.se/digitalAssets/603/c_603880-l_1-k_image.png =122x38) ![](https://live.webb.uu.se/digitalAssets/207/c_207717-l_3-k_bg-city.png) ###### tags: `UPPMAX`, `SNIC`, `conda`, `bianca`, `offline`