如何安装fiona 1.6?

问题描述 投票:1回答:2

我想安装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
python anaconda conda fiona
2个回答
0
投票

Python Versions

Conda Forge channel only has gdal v1.11.4 for Python 2.7, 3.4, and 3.5。您需要使用较新版本的Fiona(当前为1.8)或创建包含其中一个较旧的Python版本的新env。

例如,

conda create -n fiona_1_6 fiona=1.6 python=3.5

Channel defaults is Required

您面临的另一个问题是您已从配置中删除了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

Environment File

如果您拥有的不仅仅是您需要的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

-1
投票

执行错误消息告诉我的内容,

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

在搜索框中输入gdal,让我看到https://anaconda.org/conda-forge/gdal,它有这个安装说明:

conda install -c conda-forge gdal=1.11.4

尝试安装gdal依赖,也许?

© www.soinside.com 2019 - 2024. All rights reserved.