安装pygeocoder时不兼容(冲突)

2024-09-23 10:18:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法安装pygeocoder。我如何解决这一冲突? 我试过pip installconda install。理论上它似乎已经安装好了,但Jupyter笔记本找不到它

通过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']

配置详细信息

  • 视窗10
  • 水蟒
  • Python 3.6

Tags: pipthetopackageforversionrequestsconda
1条回答
网友
1楼 · 发布于 2024-09-23 10:18:43

错误显示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 ```

最佳实践解决方案是创建一个新的环境,而不是安装在基座中。我建议使用YAML文件执行此操作,并从一开始就包括您希望需要的所有内容,而不是添加特别的包

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

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

conda activate base
jupyter notebook

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

conda install -n base nb_conda_kernels

相关问题 更多 >