1

我正在尝试安装fiona=1.6,但出现以下错误

conda install fiona=1.6
WARNING: The conda.compat module is deprecated and will be removed in a future release.

Collecting package metadata: done
Solving environment: - 
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - conda-forge/noarch::flask-cors==3.0.7=py_0
  - conda-forge/osx-64::blaze==0.11.3=py36_0
  - conda-forge/noarch::flask==1.0.2=py_2
failed

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

  - fiona=1.6 -> gdal==1.11.4

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

如果我尝试安装gdal==1.11.4,我会得到以下信息

conda install -c conda-forge gdal=1.11.4

WARNING: The conda.compat module is deprecated and will be removed in a future release.
Collecting package metadata: done
Solving environment: | 
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - conda-forge/noarch::flask-cors==3.0.7=py_0
  - conda-forge/osx-64::blaze==0.11.3=py36_0
  - conda-forge/noarch::flask==1.0.2=py_2
failed

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

  - gdal=1.11.4

Current channels:

  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/osx-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/osx-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 info

conda info

     active environment : base
    active env location : /anaconda3
            shell level : 1
       user config file : /Users/massaro/.condarc
 populated config files : /Users/massaro/.condarc
          conda version : 4.6.11
    conda-build version : 3.17.8
         python version : 3.6.8.final.0
       base environment : /anaconda3  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /anaconda3/pkgs
                          /Users/massaro/.conda/pkgs
       envs directories : /anaconda3/envs
                          /Users/massaro/.conda/envs
               platform : osx-64
             user-agent : conda/4.6.11 requests/2.21.0 CPython/3.6.8 Darwin/17.5.0 OSX/10.13.4
                UID:GID : 502:20
             netrc file : None
4

2 回答 2

0

Python 版本

Conda Forge 频道只有用于 Python 2.7、3.4 和 3.5 的 gdal v1.11.4 。您要么需要使用较新版本的 Fiona(当前为 1.8),要么需要创建一个包含这些较旧 Python 版本之一的新环境。

例如,

conda create -n fiona_1_6 fiona=1.6 python=3.5

频道defaults是必需的

您面临的另一个问题是您已从defaults配置中删除了通道(根据您的conda info)。fiona=1.6仅使用conda-forge通道是不可能安装的。我的建议是在你的配置中同时拥有conda-forgedefaults,但只是设置conda-forge为具有更高的优先级(如果这是你想要的)。你可以这样做,

conda config --append channels defaults

如果您真的不想包含defaults,而只是想要一个临时解决方法,那么您可以简单地运行带有--channels | -c标志的第一个命令

conda create -n fiona_1_6 -c conda-forge -c defaults fiona=1.6 python=3.5

这仍将给予conda-forge优先权,但允许缺少的依赖项来自defaults.

环境文件

如果您需要的不仅仅是 Fiona,那么将需求文件放在一起可能会更干净,就像这样

fiona_1_6.yaml

name: fiona_1_6
channels:
 - conda-forge
 - defaults
dependencies:
 - python=3.5
 - fiona=1.6
 - osmnx

然后用这个创建新环境:

conda env create -f fiona_1_6.yaml
于 2019-04-08T16:57:20.460 回答
-1

执行错误消息告诉我的操作,

要搜索可能提供您正在寻找的 conda 包的替代渠道,请导航至https://anaconda.org

gdal在搜索框中输入将我带到https://anaconda.org/conda-forge/gdal,其中包含以下安装说明:

conda install -c conda-forge gdal=1.11.4

尝试安装gdal依赖项,也许?

于 2019-04-08T16:41:22.617 回答