penta
penta

Reputation: 2596

Conda install local package fails

I am trying to install packages in anaconda3 from a machine which does not have internet.

I downloaded the pkg.tar.gz package & ran

conda install pkgname.tar.gz

Then I get the annoying

Collecting package metadata (current_repodata.json):

& then it timesout.

I even tried the

conda install --offline pkg.tar.gz

I get

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - pkg.tar.gz

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

What am i doing wrong ?

If i try to use pip from the anaconda few of the packages get installed, but this does not.

Follow up question

If i use pip to install a pakcage, would i be able to acccess it by conda & anaconda's python ?

Upvotes: 1

Views: 3778

Answers (2)

penta
penta

Reputation: 2596

I gave up on downloading packages manually & then installing them only to find out that I need to download some more packages(chain dependency).

I found out another easier way of using conda-pack where you can build your environment in a machine that has internet(this reduces the chain dependency problem) & then .tar it, then transport it to the non-internet connected machine & then untar it.

More info can be found here https://conda.github.io/conda-pack/

I hope this solves time & effort for someone.

Upvotes: 1

Nassim Hafici
Nassim Hafici

Reputation: 460

You may find a way like this:

  1. First unzip your .gz and get the .tar

  2. Find your Conda env.

conda info --envs
  1. Use conda activate according to your env e.g:
conda activate C:\SomePathGivenByCondaInfo
  1. Use pip install with absolute path to ensure it:
pip install C:\downloads\SomePackage.tar

Upvotes: -1

Related Questions