Setting Up a Python Virtual Environment with Hydrogen in Atom

后端 未结 1 1907
野性不改
野性不改 2021-02-10 09:05

I\'m in the middle of switching from VS Code to Atom and I\'m trying to set up a virtual environment for my python project.

It was pretty easy to do in VS Code, I\'d ru

1条回答
  •  终归单人心
    2021-02-10 09:27

    Ok, after some more experimentation, I was able to connect to a kernel that I had installed my requirements.txt into.

    Here are the steps I took:

    python3 -m venv env
    source env/bin/activate
    # make sure requirements.txt has ipykernel in it
    pip3 install -r requirements.txt 
    python -m ipykernel install --user --name=env
    

    Then in Atom, press cmd-shift-p and find Hydrogen: Update Kernels.

    After, I was able to use the kernel by doing cmd-shift-p again and selecting Hydrogen: Start Local Kernel and selecting env.

    When I would run import statements via Hydrogen (selecting them and pressing cmd-enter), they would now know what to import! Horray!

    0 讨论(0)
提交回复
热议问题