【问题标题】:Incompatibility (conflicts) in installing pygeocoder安装 pygeocoder 时不兼容(冲突)
【发布时间】:2020-01-09 21:25:09
【问题描述】:

我无法安装pygeocoder。我该如何解决这个冲突? 我试过pip installconda install。理论上好像已经安装了,但是Jupyter notebook找不到。

conda install -c daviskirk pygeocoder,我看到了消息:

Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Examining wincertstore:   6%|███████▎                                                                                                                        | 2/35 [00:00<00:00, 127.99it/s]
Examining setuptools:  11%|██████████████▉                                                                                                                    | 4/35 [00:00<00:01, 23.63it/s]
Examining certifi:  43%|█████████████████████████████████████████████████████████                                                                            | 15/35 [00:00<00:00, 23.63it/| -
Comparing specs that have this dependency:   0%|                                                                                                                       | 0/2 [00:00<?, ?it/s]\
failed                                                                                                                                                                                       /
                                                                                                                                                                                             -
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

    - pygeocoder -> python=3.5
      - pygeocoder -> python[version='>=3.5,<3.6.0a0']

    Your python: conda-forge/win-64::python==3.6.7=he025d50_1005

    If python is on the left-most side of the chain, that's the version you've asked for.
    When python appears to the right, that indicates that the thing on the left is somehow
    not available for the python version you are constrained to. Note that conda will not
    change your python version to a different minor version unless you explicitly specify
    that.

    The following specifications were found to be incompatible with each other:



    Package wheel conflicts for:
    pygeocoder -> python=3.5 -> pip -> wheel
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> wheel
    Package requests conflicts for:
    pygeocoder -> requests[version='>=1.0']
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> requests
    pygeocoder -> python=3.5 -> pip -> requests
    Package ca-certificates conflicts for:
    pygeocoder -> requests[version='>=1.0'] -> urllib3[version='>=1.21.1,<1.24'] -> cryptography[version='>=1.3.4'] -> openssl=1.0 -> ca-certificates
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> requests -> urllib3[version='>=1.21.1,<1.24'] -> cryptography[version='>=1.3.4'] -> openssl=1.0 -> ca-certificates
    Package pip conflicts for:
    pygeocoder -> python=3.5 -> pip
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip
    Package certifi conflicts for:
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> setuptools -> certifi[version='>=2016.09|>=2016.9.26|>=2017.4.17']
    pygeocoder -> requests[version='>=1.0'] -> certifi[version='>=2017.4.17']
    pygeocoder -> python=3.5 -> pip -> setuptools -> certifi[version='>=2016.09']
    pygeocoder -> requests[version='>=1.0'] -> urllib3[version='>=1.21.1,<1.24'] -> certifi
    Package msgpack-python conflicts for:
    pygeocoder -> python=3.5 -> pip -> cachecontrol -> msgpack-python
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> cachecontrol -> msgpack-python
    Package setuptools conflicts for:
    pygeocoder -> python=3.5 -> pip -> setuptools
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> setuptools
    Package wincertstore conflicts for:
    pygeocoder -> python=3.5 -> pip -> setuptools -> wincertstore[version='>=0.2']
    conda-forge/win-64::python==3.6.7=he025d50_1005 -> pip -> setuptools -> wincertstore[version='>=0.2']

配置详情

  • Windows 10
  • 蟒蛇
  • Python 3.6

【问题讨论】:

    标签: python jupyter conda


    【解决方案1】:

    错误显示pygeocoder仅适用于Python 3.5:

       - pygeocoder -> python=3.5  
       - pygeocoder -> python[version='>=3.5,<3.6.0a0']
    
    Your python: conda-forge/win-64::python==3.6.7=he025d50_1005 ```
    

    对此的最佳实践解决方案是创建一个新的环境,而不是安装在 base Anaconda 环境中。我建议使用 YAML 文件并从一开始就包含您期望需要的所有内容,而不是添加包ad hoc

    pygeocoder_env.yml

    name: pygeocoder_env
    channels:
      - conda-forge
      - daviskirk
      - defaults
    dependencies:
      - python=3.5
      - pygeocoder
      - ipykernel    # needed to use this env as a Jupyter kernel
    

    创建这个环境:

    conda env create -f pygeocoder_env.yml
    

    请注意,您仍应从 base env 启动 Jupyter,但当您创建新笔记本时,您可以选择将此新 env 用作内核:

    conda activate base
    jupyter notebook
    

    如果 env 没有显示为内核选项,那么您可能需要安装 nb_conda_kernels:

    conda install -n base nb_conda_kernels
    

    【讨论】:

    猜你喜欢
    • 2016-01-09
    • 2016-01-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-20
    • 2021-04-12
    相关资源
    最近更新 更多