M2 Mac下osx-64 conda环境无法在VSCode启动Jupyter内核求助
解决M2 Mac上conda x86_64环境无法在VSCode运行Jupyter的问题
方法1:用Rosetta 2启动VSCode
- 找到应用程序中的VSCode,右键选择「显示简介」
- 勾选「使用Rosetta打开」,重启VSCode
- 重新选择
hello环境作为Jupyter内核,此时VSCode以x86_64架构运行,匹配环境架构
方法2:手动指定环境的Python解释器
- 终端激活环境:
conda activate hello - 查看环境内Python路径:
which python,复制输出的完整路径 - 在VSCode打开命令面板(Cmd+Shift+P),输入「Python: Select Interpreter」,选择「Enter interpreter path...」并粘贴路径
- 打开Jupyter Notebook,重新选择该解释器对应的内核
方法3:重装Jupyter相关包(确保x86_64版本)
- 终端激活环境:
conda activate hello - 卸载现有Jupyter组件:
conda remove --all jupyter jupyterlab ipykernel - 重新安装:
conda install jupyter jupyterlab ipykernel - 注册内核:
python -m ipykernel install --user --name hello --display-name "Python (hello)" - 重启VSCode后选择该内核
内容的提问来源于stack exchange,提问作者francoiskroll
相关产品推荐
相关产品推荐

