Rakibul Alam
Rakibul Alam

Reputation: 313

How to install packages in conda that are not available in anaconda

I want to install a package (of python) using conda, but says not available in repo.anaconda.com/......., how could I install it ?

The specific package that I tried to install is edx-dl (link of the github repo) using the code conda install edx-dl. This code works fine with pip but not with conda.

For example, in pip if I type pip install edx-dl was able to install the package when I was using python base without anaconda. But now with conda it says it is not available in anaconda repo. So if a package that are not available in anaconda, can be installed?

So to generalize, is there any way to download and install packages of python using conda which are not available in repo.anaconda.com?

Note that, I do not use base python, rather currently using anaconda. So, can't use pip to install that package.

Thanks!


Error message that I got:

(base) C:\WINDOWS\system32>conda install edx-dl

WARNING conda.base.context:use_only_tar_bz2(632): Conda is constrained to only using the old .tar.bz2 file format because you have conda-build installed, and it is <3.18.3. Update or remove conda-build to get smaller downloads and faster extractions. Collecting package metadata (repodata.json): done Solving environment: failed

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

Current channels:

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.

Upvotes: 20

Views: 55851

Answers (3)

PatrickT
PatrickT

Reputation: 10510

To install module mylib not found in conda into an environment named myenv, first find the path to the myenv environment on your system, then run the following commands at your terminal prompt:

conda activate myenv
conda install pip
/path/to/pip install mylib

Example from real life:

/Users/patrickt/miniconda3/envs/myenv/bin/pip install edx-dl

Upvotes: 0

Rakibul Alam
Rakibul Alam

Reputation: 313

Thanks @Kasper for your answer. Following your answer, I was able to solve the problem. Here I give the complete procedure for anyone who is new.

Step 1: Open "Anaconda Prompt". (I opened as "Run as Administrator" to avoid any problem in installation.)

Step 2: type conda info --envs to cheek your available environments.

  • one environment for sure you should have is base & another one Classes_and_Inheritance also should appear.

  • I had PyCharm installed, so with that I had to open some projects. So, I had some additional environments too.

Step 3: type conda activate <environment_name>

  • this environment_name should be substituted by your preferred environment (i.e. base, Classes_and_Inheritance or any other environment that you have created. )
  • In my case, I used conda activate PyCharm_Proj, but if you want, you can use this conda activate base

Step 4: type pip install <package_name>. The package_name should be substituted by the name of the package name you want to install. (i.e. in my case I typed pip install edx-dl)

Upvotes: 11

Cas
Cas

Reputation: 634

in terminal type:

conda activate <env_name>

then:

pip install edx-dl

will work on conda env this library

Upvotes: 42

Related Questions