4

I have been using conda for quite some time without problems, and just now I started to a PackagesNotFoundError error when ever I try to install a package. For example if I try:

conda install scipy --channel conda-forge

I am getting this:

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

  - scipy

Current channels:

  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - 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
  - https://conda.anaconda.org/cgat/linux-64
  - https://conda.anaconda.org/cgat/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.

But then if I use anaconda to search this package, I can see it at conda-forge channel. Then even if I use the command suggested by anaconda; conda install --channel https://conda.anaconda.org/conda-forge scipy, I get the same error.

On an attempt to solve the issue, I reinstalled a new version of conda, but the issue persists and I can't install anything with conda at the moment. Can someone give me a clue of what is going wrong?

UPDATE

As recommended by some suggestions

I have run:

conda clean -all
conda clean --index-cache
conda update conda

And I still have the same issue

The version of my current conda is 4.8.2

UPDATE 2

@merv suggested to run with the vervose flag, so I ran conda search -c conda-forge scipy -vvv and got this:

DEBUG conda.gateways.logging:set_verbosity(231): verbosity set to 3
Loading channels: ...working... TRACE conda.gateways.disk.test:file_path_is_writable(25): checking path is writable /path/miniconda/pkgs/urls.txt
DEBUG conda.core.package_cache_data:_check_writable(259): package cache directory '/path/miniconda/pkgs' writable: True
INFO conda.core.subdir_data:query_all(94): Ignoring the following channel urls because mode is offline.
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - 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
  - https://conda.anaconda.org/cgat/linux-64
  - https://conda.anaconda.org/cgat/noarch
done
No match found for: scipy. Search: *scipy*
INFO conda.core.subdir_data:query_all(94): Ignoring the following channel urls because mode is offline.
  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - 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
  - https://conda.anaconda.org/cgat/linux-64
  - https://conda.anaconda.org/cgat/noarch
Traceback (most recent call last):
  File "/path/miniconda/lib/python3.6/site-packages/conda/exceptions.py", line 1079, in __call__
    return func(*args, **kwargs)
  File "/path/miniconda/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/path/miniconda/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
    return getattr(module, func_name)(args, parser)
  File "/path/miniconda/lib/python3.6/site-packages/conda/cli/main_search.py", line 90, in execute
    raise PackagesNotFoundError((text_type(spec),), channels_urls)
conda.exceptions.PackagesNotFoundError: The following packages are not available from current channels:

  - scipy

Current channels:

  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - 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
  - https://conda.anaconda.org/cgat/linux-64
  - https://conda.anaconda.org/cgat/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.

I think the part that says Ignoring the following channel urls because mode is offline is very likely related with this error since I can't access the packages from any of the channels. However, I still don't know how to change the mode of the urls.

Geparada
  • 2,898
  • 9
  • 31
  • 43
  • 1
    Not a solution, but maybe a workaround: You could try mamba, a fast drop-in replacement for conda: `conda install -n base mamba` followed by `mamba install -c conda-forge scipy`. – cel Nov 02 '20 at 19:24
  • Maybe try a `conda clean --index-cache`? Does `conda search -c conda-forge scipy` turn up anything? Also, please add Conda version to question. – merv Nov 02 '20 at 20:35
  • @cel I tried to install mamba, but I can't find the package with conda. – Geparada Nov 03 '20 at 14:11
  • 1
    @merv I have now updated the question adding the conda version. conda `clean --all` deleted a lot of things, then `conda clean --index-cache` did not have any further effects. Finally `conda search -c conda-forge scipy` display the same error, indicating that conda cannot access the channels. – Geparada Nov 03 '20 at 14:13
  • 2
    @Geparada strange. I'm wondering if one of the dependencies of `conda` is not functioning properly. Try running with verbose flags (`-vvv`) to see if something internal is throwing warnings. – merv Nov 03 '20 at 14:30
  • @merv this was a good suggestion, please check the update 2. It seems my channels are getting ignored due to an offline mode. Any clue how to solve this? – Geparada Nov 03 '20 at 15:16
  • 2
    `conda config --set offline false` should toggle that option. Hopefully that's it, but unsure how it would have gotten switched on in the first place. – merv Nov 03 '20 at 16:47
  • @merv This indeed solved the issue! Thanks a lot :) I really do not have any idea how I managed to toggle that option. Please feel free to submit this as the final answer, or I will do it myself in order to help others with the same error. – Geparada Nov 03 '20 at 18:54

2 Answers2

2

I finally found the solution to this issue (see comments). The problem was at my conda configuration, where I was working under an offline mode. To solve this issue I just ran:

conda config --set offline false

Thanks for your help @merv!

Geparada
  • 2,898
  • 9
  • 31
  • 43
0

The packages installed would show in pip list or conda list but would throw an import error when called from jupyter or so.

After hours and hours of searching, a simple "Update index" button of the Anaconda navigator solved my problem. Update index button of Anaconda Navigator

Arbitrary
  • 1
  • 3