4

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 == ?

Ahmad
  • 1,618
  • 5
  • 24
  • 46
dsmalhan
  • 41
  • 1
  • 9

2 Answers2

4

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
merv
  • 67,214
  • 13
  • 180
  • 245
norok2
  • 25,683
  • 4
  • 73
  • 99
  • 1
    "*That version of the package is not available in the official repositories*" - technically it is, but Conda 4.7+ no longer looks in that part of the repository (designated the **free** channel). You can reenable it [as per this answer](https://stackoverflow.com/a/58220935/570918). – merv Oct 31 '19 at 22:23
  • 1
    @merv thanks for pointing this out! I have updated the answer. – norok2 Oct 31 '19 at 22:38
0

It works when I use the following code

pip install notebook==4.2.3

Thanks norok2

dsmalhan
  • 41
  • 1
  • 9