MacBook M3上conda安装nb_conda_kernels报错及解决方法咨询
问题
在Apple MacBook M3上安装Jupyter Notebook时,执行命令 conda install -c conda-forge nb_conda_kernels 遇到如下错误:
Solving environment: | warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE failed LibMambaUnsatisfiableError: Encountered problems while solving: - nothing provides _python_rc needed by python-3.12.0rc3-rc3_h47c9636_1_cpython Could not solve for environment specs The following packages are incompatible ├─ nb_conda_kernels is installable with the potential options │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.10,<3.11.0a0 *_cpython, which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.11,<3.12.0a0 *_cpython, which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.8,<3.9.0a0 , which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.8,<3.9.0a0 *_cpython, which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.9,<3.10.0a0 , which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.9,<3.10.0a0 *_cpython, which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.8,<3.12 with the potential options │ │ ├─ python [3.10.0|3.10.1|...|3.10.9], which can be installed; │ │ ├─ python [3.11.0|3.11.1|...|3.11.8], which can be installed; │ │ ├─ python [3.8.10|3.8.12|...|3.8.8], which can be installed; │ │ ├─ python [3.9.0|3.9.1|...|3.9.9], which can be installed; │ │ ├─ python 3.12.0rc3 would require │ │ │ └─ _python_rc, which does not exist (perhaps a missing channel); │ │ ├─ python [3.10.0|3.10.10|...|3.10.9], which can be installed; │ │ ├─ python [3.11.0|3.11.2|...|3.11.8], which can be installed; │ │ ├─ python [3.8.11|3.8.13|...|3.8.19], which can be installed; │ │ └─ python [3.9.11|3.9.12|...|3.9.7], `your text` │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ __win, which is missing on the system; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.8,<3.11 , which can be installed; │ ├─ nb_conda_kernels 2.3.1 would require │ │ └─ python >=3.10,<3.11.0a0 , which can be installed; │ └─ nb_conda_kernels 2.3.1 would require │ └─ python >=3.11,<3.12.0a0 , which can be installed; └─ pin-1 is not installable because it requires └─ python 3.12.* , which conflicts with any installable versions previously reported. Pins seem to be involved in the conflict. Currently pinned specs: - python 3.12.* (labeled as 'pin-1')
错误原因
- 版本兼容冲突:当前conda环境固定了Python 3.12版本(标记为pin-1),但
nb_conda_kernels 2.3.1的所有可用版本仅支持Python 3.8~3.11(要求<3.12),两者直接冲突。 - 测试版依赖缺失:你使用的Python是3.12.0rc3(候选发布版),conda源中没有它需要的
_python_rc依赖包,这也导致环境求解失败。
修复方案
方案一:创建新的兼容环境(推荐)
新建一个指定Python 3.11的环境,避免破坏现有环境:
# 创建新环境并指定Python 3.11 conda create -n jupyter_env python=3.11 # 激活新环境 conda activate jupyter_env # 安装nb_conda_kernels和Jupyter Notebook conda install -c conda-forge nb_conda_kernels jupyter notebook
方案二:降级现有环境的Python版本
如果不想新建环境,可以解除Python版本固定并降级到3.11:
# 移除Python 3.12的版本固定 conda config --remove pinned_packages python=3.12.* # 降级Python到3.11 conda install python=3.11 # 重新安装nb_conda_kernels conda install -c conda-forge nb_conda_kernels
方案三:等待官方兼容更新
如果不急着使用,可以等待nb_conda_kernels发布支持Python 3.12的版本,但这个时间不确定,不推荐紧急场景使用。
内容的提问来源于stack exchange,提问作者Steady Prog
相关产品推荐
相关产品推荐

