Anaconda安装matplotlib-basemap失败及xlsxwriter相关问题求助
Troubleshooting matplotlib-basemap Installation Issues (No Need to Uninstall xlsxwriter!)
Hey there! Let's work through your basemap installation problems together—first off, you absolutely don't need to uninstall xlsxwriter to get basemap working. These two tools serve totally different purposes and rarely conflict. Let's break down solutions for both installation methods you tried:
1. Fixing Anaconda Prompt Installation Failures
Start with these quick checks and fixes:
- First, update your conda package manager to avoid outdated dependency issues:
conda update conda - Instead of the default conda channels, use conda-forge (it maintains more up-to-date basemap builds):
conda install -c conda-forge basemap - If you still get errors, look closely at the error message—usually it'll point to a missing dependency or version mismatch. That detail would help narrow things down further, but let's move to the whl file method next.
2. Resolving Gohlke Pythonlibs Installation Errors
The most common issue here is downloading a whl file that doesn't match your system/Python setup:
- Double-check that the whl file matches your Python version (e.g.,
cp39for Python 3.9) and system architecture (64-bit systems needamd64in the filename). - Upgrade pip first to ensure it can handle the whl file properly:
pip install --upgrade pip - Install basemap's required dependencies before installing the whl:
pip install pyproj pyshp - Now install the downloaded whl file (replace the filename with your actual download):
pip install basemap-1.3.6-cp39-none-win_amd64.whl
3. If You Do Run Into Dependency Conflicts (Unlikely!)
If by some chance you see a conflict between xlsxwriter and basemap's dependencies, create a separate conda environment for basemap. This keeps your existing environment (with xlsxwriter) untouched:
- Create a new environment (you can pick any name, here we use
basemap_env):conda create -n basemap_env python=3.9 - Activate the new environment:
conda activate basemap_env - Install basemap in this isolated environment:
conda install -c conda-forge basemap - When you need to use xlsxwriter, just switch back to your original environment with
conda activate your_original_env_name.
内容的提问来源于stack exchange,提问作者Jellyse
相关产品推荐
相关产品推荐

