Installing or Updating Conda without an Internet Connection

Instead of using Conda, try using Poetry (https://python-poetry.org/) which is a Python package designed to handle package dependencies. To use Poetry, first install it, then create a virtual environment for your project using Pyenv or any other tool. Once you activate your virtual environment, create a Poetry project and add your package dependencies to your virtual environment. Poetry takes care of package dependencies and also provides commands to update package versions easily. However, you will need to manually check the dependencies of the packages to be installed which can be time-consuming.

Question:

I’m attempting to update xlwings offline within Anaconda/conda.

I obtained the latest package of xlwings from https://pypi.python.org/pypi/xlwings and placed it in the directory “C:Program FilesAnaconda2pkgs”.

Despite attempting various combinations through Cmd, updating the package remains a challenge for me. As an illustration, I’ve encountered the following issues:

1) conda install xlwings --offline
2) conda install xlwings --offline xlwings-0.10.2.tar.gz
3) conda update xlwings --offline
4) conda update xlwings --offline xlwings-0.10.2.tar.gz

The second and fourth attempts, even with the full directory, lead to an unrecognized command.

The outcomes of attempts 1 and 3 can be seen in the image labeled as

.


Solution 1:

Begin by downloading the appropriate file, labeled with the package name and
tar.bz2
, from the Anaconda repository.

Navigate to the appropriate directory in the command prompt and execute the command.

conda install package-name.tar.bz2

This should work.


Solution 2:

From my experience the process is:

  1. Install the necessary packages on a computer that is linked to
    internet install
    .
  2. Retrieve the necessary files of

    tar.bz2

    from the ~/anaconda3/pkgs directory.
  3. Execute the

    conda update name_of_packge.tar.bz2 --offline

    in the computer’s offline mode.

It may be necessary to execute

conda index

on the specified directory

pkgs

.

An alternative method is to utilize conda pack, which facilitates the transfer of complete environments from online to offline.


Solution 3:


To update or install
conda package
, it is necessary to obtain the appropriate conda package and place it in the

pkgs

directory, rather than using the previously downloaded pip package.

conda install xlwings --use-index-cache

Previously, it was effective, however, the index cache of the channel ought to have been refreshed at least once. While it’s plausible that the

--offline

flag is still required, I haven’t personally utilized it. Nevertheless, you must verify the dependencies of the packages that need to be installed on your own, which may consume a significant amount of time as you have to download all other
packages manually
.

The channel being used, which is https://repo.continuum.io/pkgs/free/win-32/ in my case, is where the conda packages can be located.

To install a pip
package offline
, simply use the command.

pip install package.tar.gz

The

pip

is included in the anaconda distribution, and if you are utilizing conda environments, pip will automatically be added to your current environment’s path.


Solution 4:

It is recommended to utilize a blend of both responses.

conda install opencv --use-index-cache

Enable conda to verify dependencies and ensure compatibility.

Unless there are valid reasons to switch from the initial framework, it is recommended to continue using conda for the installation process. After all, the reason for using conda as a package manager was to take advantage of the opportunities and flexibility that pip could not provide.

conda install opencv-3.3.0-py36_200.tar.bz2

Frequently Asked Questions