安装geopandas会卸载底图&反之亦然 [英] Installing geopandas uninstalls basemap & vice-versa

查看:81
本文介绍了安装geopandas会卸载底图&反之亦然的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个既具有底图又具有geopandas的Python环境,但是安装其中一个会删除另一个环境.无论是要同时拥有这两者,还是有合理的方法在同一个脚本的解释器之间进行切换?

I need a Python environment with both basemap and geopandas, but installing one removes the other. Is there anyway to have both, or is there a reasonable way to switch between interpreters in the same script?

我知道底图会因为Cartopy而贬值,但是我正在使用底图,这就是现在的情况.

I know basemap is being depreciated for cartopy, but I'm working with basemap and it is what is for now.

使用Anaconda3,Python 3.7.6

Using Anaconda3, Python 3.7.6

以下是我在基本环境中所采取的步骤:

Here are the steps I have taken, just using the base environment:

conda install -c conda-forge basemap
conda install geopandas

## I kept having issues with installing geopandas:
## Solving environment: failed with initial frozen solve. Retrying with flexible solve.

## So I followed the solution by "forskamse" here [https://github.com/conda/conda/issues/9367] 
conda activate base
conda config --set auto_update_conda False
conda install conda=4.6.14
conda install geopandas

这成功安装了geopandas,但删除了底图:

This successfully installed geopandas, but it removed basemap:

The following packages will be REMOVED:

  anaconda-2020.02-py37_0
  basemap-1.3.0-py37h7cd9bad_2
  python_abi-3.7-1_cp37m

还通过 conda list 检查删除了已确认的底图.

Also confirmed basemap is removed by conda list inspection.

我还尝试了 geopandas安装页面上建议的新环境,但是我得到了一个一堆解决了安装joblib和scikit-learn ...以及其他库的环境错误,我当时停止尝试.

I have also tried a new environment as suggested on the geopandas install page, but I get a bunch of Solving environment errors installing joblib and scikit-learn... and maybe other libraries, I stopped trying at that point.

推荐答案

不同的 conda 频道具有不同的兼容性,因此您应始终尝试使用单个频道,即 defaults 或(最好是) conda-forge .从 conda-forge 安装 geopandas basemap 应该可以解决兼容性问题,并允许您同时安装两者.

Different conda channels offer different compatibility and you should always try to stick to a single channel, either defaults or (preferably) conda-forge. Installing geopandas and basemap both from conda-forge should resolve the compatibility issue and allow you to instal both.

conda install -c conda-forge geopandas basemap

Python地理空间堆栈的一般建议遵循 conda-forge .

General advice for Python geospatial stack is stick to conda-forge.

这篇关于安装geopandas会卸载底图&反之亦然的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆