dsmalhan
dsmalhan

Reputation: 41

Unable to install packages in Anaconda virtual environment. 'Packages are not available from current channels'

I am trying to create a new Python environment in Anaconda. I am using Anaconda Powershell Prompt and created the environment using the

conda create --name adwp1 python=3.5 -y;
conda activate adwp1  
conda install notebook=4.2.3 -y;

and

pip install notebook=4.2.3

I get the following error when I use conda install

    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:

  - notebook=4.2.3

Current channels:

  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/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.

**and when I use ** pip install then I get the following error

ERROR: Invalid requirement: 'notebook=4.2.3' Hint: = is not a valid operator. Did you mean == ?

Upvotes: 4

Views: 7730

Answers (2)

norok2
norok2

Reputation: 26886

That version of the package is not available in the official repositories, so you have to install it from somewhere else. Luckily, this is available in the conda-forge user-maintained repositories. If you trust the maintainer of the package, you can simply do:

conda install -c conda-forge -y notebook=4.2.3

EDIT

As per @merv comment, it may also be possible to get this package by restoring the free channel searching, which can be done essentially by setting to 1 the CONDA_RESTORE_FREE_CHANNEL environment variable:

CONDA_RESTORE_FREE_CHANNEL=1 conda install -y notebook=4.2.3

or by setting the corresponding config flag to true:

conda config --set restore_free_channel true

As far as the pip command is concerned, this is simply a typo (as suggested in the error message): replacing = with == should do the trick:

pip install notebook==4.2.3

Upvotes: 4

dsmalhan
dsmalhan

Reputation: 41

It works when I use the following code

pip install notebook==4.2.3

Thanks norok2

Upvotes: 0

Related Questions