重装pandas/numpy后pip、conda及Spyder故障:backports.configparser缺失
Hey, let’s work through this mess step by step—this kind of dependency conflict is super common when you’ve got multiple Python environments (like your Microsoft Store Python 3.7 and Anaconda setup) clashing. Here’s how to fix it:
The error log shows your system is mixing paths from two different Python installations, which is why pip/conda are breaking. First, use the Anaconda Prompt (not regular Command Prompt) to ensure you’re working in the right environment:
- Open Anaconda Prompt and run
where python—make sure the top result is your Anaconda Python path (e.g.,C:\Users\gdeemer\AppData\Local\Continuum\anaconda3\python.exe), not the one inWindowsApps. - If it’s not, adjust your system PATH to put the Anaconda directory first, and remove the Microsoft Store Python entry entirely (this will prevent future conflicts).
backports.configparser Module Since pip is currently broken, we’ll use Python’s built-in module to repair things first:
- In Anaconda Prompt, run this to ensure pip itself is functional:
python -m ensurepip --upgrade - Then install the missing module directly via Python’s pip module:
python -m pip install backports.configparser - If that fails (e.g., no internet), download the compatible
.whlfile for Python 3.7 (look for something likebackports.configparser-1.0.3-py2.py3-none-any.whl) and install it locally:python -m pip install C:\path\to\your\downloaded\file.whl
Now that pip/conda are working again, fix the original dependency issue using Anaconda’s package manager (way more stable for Anaconda environments than pip):
conda uninstall pandas numpy --yes conda install pandas numpy
Spyder’s broken because its underlying environment was messed up. Fix it with these steps:
- Update Spyder to the latest compatible version:
conda update spyder - If that doesn’t work, do a clean reinstall:
conda uninstall spyder --yes conda clean --all --yes conda install spyder
- Stop mixing pip and conda in your Anaconda environment—conda manages dependencies to keep things compatible, while pip can overwrite or break Anaconda’s carefully curated packages.
- Use conda virtual environments (
conda create -n myenv pandas numpy spyder) to isolate different projects—this way, one project’s dependency issues won’t take down your whole setup.
内容的提问来源于stack exchange,提问作者EisMann88

