我在conda频道中加入了conda-:
$ conda config --show channels
channels:
- conda-forge
- defaults除其他外,我的requirements.txt包含以下几行:
ipython-genutils==0.2.0
jupyter-client==6.1.12
jupyterlab-pygments==0.1.2
appnope==0.1.2
jupyterlab-widgets==1.0.0
data==0.4
prometheus-client==0.11.0
latex==0.7.0
scipy==1.5.4
jupyter-core==4.7.1
jupyter-console==6.4.0
async-generator==1.10
vg==1.10.0
sklearn==0.0
postgis==1.0.4当我尝试使用conda从这个requirements.txt创建一个新的环境时
conda create --name myenv --file requirements.txt
我得到以下错误:
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- ipython-genutils==0.2.0
- jupyter-client==6.1.12
- jupyterlab-pygments==0.1.2
- appnope==0.1.2
- jupyterlab-widgets==1.0.0
- data==0.4
- prometheus-client==0.11.0
- latex==0.7.0
- scipy==1.5.4
- jupyter-core==4.7.1
- jupyter-console==6.4.0
- async-generator==1.10
- vg==1.10.0
- sklearn==0.0
- postgis==1.0.4
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.正如你所看到的,conda被列在“当前渠道”和==0.2.0可在conda-forge中使用。之下。但是,没有找到该包。我怎样才能解决这个问题?
我试过conda config --set channel_priority flexible和... stable
我运行了Ubuntu20.04LTS、Python3.10和Conda4.12.0
发布于 2022-04-22 08:40:52
在我看来,这应该是一个由pip使用的requirements.txt。请注意,conda包的名称可能与pypi上的名称略有不同。
ipython-genutils不是正确的名称,查看您提供的链接,包的名称是带有下划线的ipython_genutils。您用连字符编写的其他包也是如此。它们都应该用下划线拼写。
只剩下
- sklearn==0.0
- latex==0.7.0
- vg==1.10.0
- scipy==1.5.4
- postgis==1.0.4
- data==0.4
- appnope==0.1.2sklearn==0.0在您的文件中似乎是一个损坏的行。这个包的名字是scikit-learn。据我所知,latex、vg和data无法在conda频道上使用。scipy==1.5.4也是如此,只有1.5.3和1.6可用。postgis只能追溯到conda上的2.4.3,参见这里,但它似乎也不同于pypi上可用的内容。appnope是一个仅适用于macOS的包,请参阅这是描述
在macOS >= 10.9上禁用App的简单包可能会有问题。
因此,我们可以创建一个从conda通道和pip安装的yml文件(对文件的更改:用_替换_,删除appnope,添加pip依赖项,将sklearn重命名为scikit-learn,并将其与latex、scipy、vg、data、postgis移到pip要求一起移动。如果您对scipy==1.5.4很灵活,我建议将其更改为scipy==1.5.3或scipy==1.6.0,并将scipy和sklearn移出已安装的pip软件包):
name: myenv
dependencies:
- ipython_genutils==0.2.0
- jupyter_client==6.1.12
- jupyterlab_pygments==0.1.2
- jupyterlab_widgets==1.0.0
- prometheus_client==0.11.0
- jupyter_core==4.7.1
- jupyter_console==6.4.0
- async_generator==1.10
- pip
- pip:
- scikit-learn
- latex==0.7.0
- scipy==1.5.4
- vg==1.10.0
- data==0.4.0
- postgis==1.0.4 将其保存为environment.yml,然后执行
conda env create -f environment.ymlhttps://stackoverflow.com/questions/71963401
复制相似问题