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

如何在Atom的Hydrogen中配置使用Python 3运行脚本?

Configure Hydrogen in Atom to Use Python 3 on Mac

Got it, let's get your Hydrogen set up to run scripts with Python 3 instead of your Mac's default Python 2. Here's a straightforward, step-by-step guide:

Step 1: Locate your Python 3 installation path

First, open Terminal and run this command to get the exact file path of your Python 3 installation:

which python3

You’ll get a result like /usr/local/bin/python3 (for Intel-based Macs) or /opt/homebrew/bin/python3 (for Apple Silicon Macs). Keep this path handy—you might need it if things don’t work smoothly later.

Step 2: Install and register the Python 3 kernel for Hydrogen

Hydrogen relies on IPython kernels to execute code, so we need to set up a dedicated Python 3 kernel. Run these commands in Terminal one after another:

  1. Install the ipykernel package (this bridges Hydrogen and Python 3):
    python3 -m pip install ipykernel
    
  2. Register the Python 3 kernel with Jupyter (Hydrogen uses Jupyter under the hood):
    python3 -m ipykernel install --user --name python3 --display-name "Python 3"
    

Step 3: Select Python 3 as your active kernel in Hydrogen

Open Atom and pull up a Python file you want to run:

  • Press Cmd+Shift+P (Mac shortcut) to open the command panel.
  • Type Hydrogen: Select Kernel and hit Enter.
  • From the dropdown menu, pick the Python 3 option we just registered.

Optional: Set Python 3 as the default kernel

If you want Hydrogen to automatically use Python 3 every time you launch it:

  • Open Atom’s settings by pressing Cmd+,.
  • Search for "Hydrogen" in the settings sidebar.
  • Scroll down to the "Default Kernel" section, then select python3 from the dropdown list.

That’s all! Now when you run code blocks with Hydrogen (either via the run button or Cmd+Enter), it’ll use Python 3 instead of the system’s old Python 2.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.27 07:27:11