You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法在Anaconda环境安装basemap包,求助替代安装方案

Solutions for Basemap-Zict Dependency Conflict in Anaconda

Got it, this dependency conflict between basemap and zict is super frustrating—here are several workarounds you can try without deleting the zict package:

1. Create an Isolated Conda Environment (Safest Bet)

The easiest way to avoid dependency clashes is to spin up a brand-new environment dedicated to basemap. This keeps your existing environment (with zict) completely untouched:

# Create a new environment with a Python version compatible with basemap (3.8-3.10 works well)
conda create -n basemap-env python=3.9
# Activate the environment
conda activate basemap-env
# Install basemap from conda-forge (more reliable than default channels)
conda install -c conda-forge basemap

When you need to use basemap, just activate this environment; switch back to your main env when you’re done.

2. Install Basemap via Pip (Bypass Conda Dependency Checks)

If you want to stick with your current environment, try installing basemap with pip instead of conda. First, make sure you have the required system dependency geos installed via conda:

# Install GEOS (a mandatory dependency for basemap)
conda install geos
# Now install basemap using pip
pip install basemap

Note: Mixing conda and pip can sometimes cause subtle compatibility quirks, but this often works for basemap since pip’s dependency resolution handles packages differently than conda.

3. Install a Specific Compatible Version of Basemap

The conflict might be tied to the latest basemap release. Try installing an older, well-tested version that plays nice with your current zict package:

conda install -c conda-forge basemap=1.2.2

You can search for other compatible versions using this command:

conda search -c conda-forge basemap

4. Configure Conda-forge as Priority Channel

Default conda channels sometimes have outdated dependency trees. Switching to conda-forge with strict priority can resolve conflicts by pulling aligned, up-to-date package versions:

# Add conda-forge channel and set it as the highest priority
conda config --add channels conda-forge
conda config --set channel_priority strict
# Try installing basemap again
conda install basemap

This tells conda to prioritize packages from conda-forge, which typically has better dependency alignment for niche packages like basemap.


内容的提问来源于stack exchange,提问作者Bram van der Plas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:44:21