VS2017 Preview调试Python导入pandas/matplotlib时异常求助
Hey there! Let's work through this debugging issue you're hitting with Visual Studio 2017 Preview and your Anaconda3 environment. I've run into similar quirks with older VS Python tooling before, so here are actionable steps to troubleshoot:
1. Double-check your VS Python environment configuration
- Open Visual Studio, go to
Tools > Python > Python Environments - Make sure the active environment is your Anaconda3 Python 3.6 installation (not a system Python or other virtual env)
- If it's not selected, right-click the Anaconda3 entry and choose
Set as Defaultto ensure VS uses the correct interpreter and package set
2. Repair the Visual Studio Python workload
The error about the debug adapter exiting and GUID parsing failure points to a possible corrupted VS component. Here's how to fix it:
- Launch the Visual Studio Installer, find your VS 2017 Preview instance, and click
Modify - Uncheck the Python development workload, click
Modifyto uninstall it - Once uninstalled, re-check the Python workload and click
Modifyagain to reinstall it - This will refresh the debug adapter and related tooling that's causing the crash
3. Update your Anaconda packages and VS itself
Outdated packages or VS versions often cause compatibility issues:
- Open Anaconda Prompt and run:
This will update numpy, pandas, matplotlib, and all other packages to versions that play nicer with VS 2017's debuggerconda update --all - In Visual Studio, go to
Help > Check for Updatesto ensure your VS 2017 Preview and Python tools are fully updated
4. Adjust your debugging approach temporarily
Sometimes the debugger struggles with breakpoints on large library imports:
- Move your breakpoint to a line after all imports (e.g., add a
print("Imports completed")line and break there) - Start debugging normally (F5) instead of stepping through imports
- If this works, the issue is specific to the debugger handling import steps, and you can work around it until VS updates fix the root cause
5. Test in a clean Anaconda environment
A corrupted environment or package conflict might be the culprit:
- Create a fresh Anaconda environment with:
conda create -n vs_test_env python=3.6 pandas matplotlib numpy - Switch to this new environment in VS's Python Environments panel
- Run your import code again—if it works, your original environment had corrupted files or conflicting packages
Quick note on the GUID error
That Failed to parse service's registered package GUID message is a VS internal registration issue. Reinstalling the Python workload (step 2) or resetting VS settings (Tools > Import and Export Settings > Reset all settings) should resolve it.
Hope one of these fixes gets you up and running! Let me know if you hit any snags.
内容的提问来源于stack exchange,提问作者Bev

