You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在新conda环境tf中无法启动Jupyter Notebook的问题咨询

Jupyter Notebook无法启动问题的原因及解决

我创建了名为tf的TensorFlow conda环境,环境可正常使用,但执行以下安装步骤运行Jupyter Notebook时出现问题:

conda install ipykernel (执行成功)
python -m ipykernel install --user --name=tf (执行成功)
jupyter notebook (执行报错)

执行jupyter命令返回:

(tf) C:\Users\Anonymous>jupyter
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]

Jupyter: Interactive Computing

positional arguments:
  subcommand     the subcommand to launch

options:
  -h, --help     show this help message and exit
  --version      show the versions of core jupyter packages and exit
  --config-dir   show Jupyter config dir
  --data-dir     show Jupyter data dir
  --runtime-dir  show Jupyter runtime dir
  --paths        show all Jupyter paths. Add --json for machine-readable format.
  --json         output paths as machine-readable json
  --debug        output debug information about paths

Available subcommands: kernel kernelspec migrate run script troubleshoot

Please specify a subcommand or one of the optional arguments.

执行jupyter notebook命令返回:

(tf) C:\Users\Anonymous>jupyter notebook
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]

Jupyter: Interactive Computing

positional arguments:
  subcommand     the subcommand to launch

options:
  -h, --help     show this help message and exit
  --version      show the versions of core jupyter packages and exit
  --config-dir   show Jupyter config dir
  --data-dir     show Jupyter data dir
  --runtime-dir  show Jupyter runtime dir
  --paths        show all Jupyter paths. Add --json for machine-readable format.
  --json         output paths as machine-readable json
  --debug        output debug information about paths

Available subcommands: kernel kernelspec migrate run script troubleshoot

Jupyter command `jupyter-notebook` not found.

问题原因

你只安装了ipykernel(用于让Jupyter识别conda环境作为运行内核),但没有在tf环境中安装Jupyter Notebook的核心程序,所以系统找不到jupyter-notebook命令,导致执行失败。

解决步骤

  1. 确保处于激活的tf环境中:
    conda activate tf
    
  2. 在tf环境内安装Jupyter Notebook:
    conda install jupyter notebook
    
    也可以用pip安装:
    pip install jupyter notebook
    
  3. 安装完成后,重新执行jupyter notebook即可正常启动。

补充说明

如果之前在base环境中安装过Jupyter,也可以直接从base环境启动Jupyter,然后在Notebook中选择tf内核运行代码,但这种方式可能存在路径依赖问题,不如直接在tf环境内安装Jupyter稳定。

内容的提问来源于stack exchange,提问作者Kim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 12:15:15