简体   繁体   English

PackagesNotFoundError:以下软件包在当前频道中不可用,添加 conda-forge 频道后?

[英]PackagesNotFoundError: The following packages are not available from current channels, AFTER adding conda-forge channel?

Even after adding conda forge channel as suggested here:即使按照此处的建议添加了 conda forge 通道:

PackagesNotFoundError: The following packages are not available from current channels: PackagesNotFoundError:当前频道不提供以下软件包:

Conda cannot still install many of the packages in a requirements.txt file: Conda 仍然无法在 requirements.txt 文件中安装许多包:

conda install --file pip_requirements/requirements.txt 
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:

  - prompt-toolkit==1.0.16
  - torch==1.0.0
  - chainer==2.0.1
  - ipython-genutils==0.2.0
  - gym==0.9.2
  - lief
  - chainerrl==0.2.0

Current channels:

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

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.

Whats the use of conda if it cant even find a popular package like TORCH?!如果 conda 甚至找不到像 TORCH 这样流行的 package 有什么用?!

Tried installing with pipenv too, that didnt work either..也试过用 pipenv 安装,那也没有用..

pipenv install -r pip_requirements/requirements.txt 
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.8.5) to create virtualenv…
⠋ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
Error while trying to remove the /home/Johnny/.local/share/virtualenvs/myproject-uxejE6Q_ env: 
No such file or directory

Virtualenv location: 
Creating a Pipfile for this project…
Requirements file provided! Importing into Pipfile…
Creating a virtualenv for this project…
Using /usr/bin/python3 (3.8.5) to create virtualenv…
⠙ModuleNotFoundError: No module named 'virtualenv.seed.via_app_data'
Error while trying to remove the /home/Johnny/.local/share/virtualenvs/myproject-uxejE6Q_ env: 
No such file or directory

Virtualenv location: 
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…

Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches Pygments<3.0.0,==2.4.2,>=2.6.0
Tried: 0.5, 0.5.1, 0.6, 0.7, 0.7.1, 0.8, 0.8.1, 0.9, 0.10, 0.11, 0.11.1, 1.0, 1.1, 1.1.1, 1.2, 1.2.1, 1.2.2, 1.3, 1.3.1, 1.4, 1.5, 1.6rc1, 1.6, 2.0rc1, 2.0rc1, 2.0rc1, 2.0, 2.0, 2.0, 2.0.1, 2.0.1, 2.0.1, 2.0.2, 2.0.2, 2.0.2, 2.1, 2.1, 2.1, 2.1.1, 2.1.1, 2.1.2, 2.1.2, 2.1.3, 2.1.3, 2.2.0, 2.2.0, 2.3.0, 2.3.0, 2.3.1, 2.3.1, 2.4.0, 2.4.0, 2.4.1, 2.4.1, 2.4.2, 2.4.2, 2.5.1, 2.5.1, 2.5.2, 2.5.2, 2.6.0, 2.6.0, 2.6.1, 2.6.1, 2.7.0, 2.7.0, 2.7.1, 2.7.1, 2.7.2, 2.7.2

There are a few issues:有几个问题:

  1. Old Packages .旧包 A few of those packages are available through both defaults and conda-forge channels, but the versions you are requesting are quite old.其中一些软件包可通过默认conda-forge渠道获得,但您请求的版本相当旧。 If you must have such old versions, then switch to using a YAML , and including a pip: section to install them from PyPI.如果你必须有这样的旧版本,然后切换到使用 YAML ,并包括pip:部分从 PyPI 安装它们。

  2. Package Naming . Package 命名 Unfortunately, there is not a uniformly enforced policy on Conda package naming, and since Conda supports a broader language base than PyPI, there are inevitable naming collisions.不幸的是,对于 Conda package 命名没有统一的强制执行策略,而且由于 Conda 支持比 PyPI 更广泛的语言库,因此不可避免地存在命名冲突。 One of the common, but not universally adopted naming strategies is <language>-<package> , which for Python is usually, py-<package> .一种常见但未被普遍采用的命名策略是<language>-<package> ,对于 Python 通常是 py- py-<package> I suspect lief is one of these, ie, you actually want py-lief .我怀疑lief就是其中之一,即您实际上想要py-lief

  3. Specialized Channels .专业频道 Not every package maintainer has adopted Conda Forge, and PyTorch is a key one.不是每个 package 维护者都采用了 Conda Forge,PyTorch 是关键。 If you need PyTorch packages, you'll need the pytorch channel .如果您需要 PyTorch 包,则需要pytorch通道

Overall, be aware that you are switching to a new ecosystem and it's not perfect, and sometimes not even reasonable.总的来说,请注意您正在切换到一个新的生态系统,它并不完美,有时甚至不合理。 Unfortunately, there is no simple pip freeze to conda install workflow that sources all packages from Conda.不幸的是,没有简单的pip freeze到 conda conda install工作流,它从 Conda 获取所有包。

There is kind of an exception to this , which is to not use Conda package management at all, but instead only use it for environment creation, isolation, and activation.有一个例外,那就是根本不使用 Conda package 管理,而仅将其用于环境创建、隔离和激活。 Doing so sacrifices all the redundancy reduction and deep dependency resolution that Conda provides, but I suppose for a quick-and-dirty recreation of an existing PyPI-based install it may have a time and place.这样做会牺牲 Conda 提供的所有冗余减少和深度依赖解决方案,但我认为对于现有的基于 PyPI 的安装的快速而肮脏的重新创建它可能有时间和地点。

Otherwise, I recommend making a point to search Anaconda Cloud before installing a new package, to make sure the description matches what one actually wants to install.否则,我建议在安装新的 package 之前先搜索 Anaconda Cloud ,以确保描述与实际想要安装的内容相符。

To install PyTorch just try this Command in a shell要安装 PyTorch,只需在 shell 中尝试此命令

conda install -c pytorch pytorch

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PackagesNotFoundError:当前频道不提供以下软件包 - PackagesNotFoundError: The following packages are not available from current channels `PackagesNotFoundError: 当前频道不提供以下软件包` - `PackagesNotFoundError: The following packages are not available from current channels` 如何解决 conda 问题:PackagesNotFoundError:当前渠道中不提供以下软件包 - How to resolve the conda issue: PackagesNotFoundError: The following packages are not available from current channels (imutils)PackagesNotFoundError:当前频道不提供以下软件包: - (imutils) PackagesNotFoundError: The following packages are not available from current channels: PackagesNotFoundError:当前渠道中不提供以下软件包:-管理 - PackagesNotFoundError: The following packages are not available from current channels: - manage 无法安装 tensorflow:PackagesNotFoundError:以下软件包在当前频道中不可用 - unable to install tensorflow: PackagesNotFoundError: The following packages are not available from current channels PackagesNotFoundError:当前频道不提供以下软件包。 怎么解决? - PackagesNotFoundError: The following packages are not available from current channels. How to solve? PackagesNotFoundError:当前频道不提供以下软件包。(Anaconda) - PackagesNotFoundError: The following packages are not available from current channels.(Anaconda) PackagesNotFoundError:以下软件包 pykg-config 在当前频道中不可用: - PackagesNotFoundError: The following packages pykg-config are not available from current channels: pygraphviz 的 conda-forge PackagesNotFoundError - conda-forge PackagesNotFoundError for pygraphviz
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM