如何解决Conda和Python共存环境下Jupyter Notebook启动冲突问题?

摘要:在日常开发中,很多人(包括我)在同时安装了 Anaconda 和 原生 Python(如 Python 3.12) 的 Windows 环境中运行 Jupyter Notebook,结果遇到了启动报错、DLL 加载失败等一系列诡异的问题。这
在日常开发中,很多人(包括我)在同时安装了 Anaconda 和 原生 Python(如 Python 3.12) 的 Windows 环境中运行 Jupyter Notebook,结果遇到了启动报错、DLL 加载失败等一系列诡异的问题。这篇文章记录我解决 Jupyter 启动冲突的完整过程,并附上具体的报错信息、成因分析与最终的修复命令,供有类似需求的朋友参考。 🧨 问题背景 我希望通过 PyCharm 启动 Jupyter Notebook 服务,初始使用如下命令: C:\Python312\python.exe -m jupyter -m notebook --notebook-dir=C:\Users\onefly\Desktop\AlphaDetector --no-browser --port=8889 结果却接连报错,例如: ImportError: DLL load failed while importing _device: 找不到指定的模块。 Traceback (most recent call last): ... File "...\zmq\backend\__init__.py", line 31, in <module> raise original_error from None ImportError: DLL load failed while importing _device: 找不到指定的模块。
阅读全文