Hasarindu Perera
hasarinduperera

3

Posted

Running CLI on GitHub Codespaces

I tried running the CLI on GitHub Codespaces and am having difficulty selecting the kernel in the notebook. Unlike VSCode, Codespaces does not allow selecting existing virtual environments, though it does allow creating new ones. It would be helpful if I could run the CLI smoothly on Codespaces as well.
TIA.

Order by:

Antoine Chauvin

3

Posted by antoine

I'm Antoine, a software engineer at Aqora. I understand you're looking to use GitHub Codespaces, and I'd be happy to help. Which competitions are you interested in participating in?
I went through the tutorial this morning and successfully configured a virtual environment—specifically the one created by aqora template h2-groundstate-energy. Here's a step-by-step guide that worked for me:
  1. Wait for your Codespace to fully initialize (you'll see a prompt to press Enter)
  2. Install aqora using pipx install aqora-cli
  3. Choose one of these options:
    • For a new submission, run:
      aqora template [competition] .
      (replace [competition] with your chosen competition)
    • For an existing submission, run:
      aqora install
      in your submission's root directory
  4. Open the notebook (in my case, it was submission/start_here.ipynb)
  5. Click "Select Kernel" in the top-right corner
  6. Install/enable the recommended Python and Jupyter extensions
  7. From the dropdown menu, select "Python Environments..."
  8. Choose "Create Python Environment"
  9. Select "Venv Creates a .venv virtual environment in the current workspace"
  10. Finally, select "Use existing '.venv' environment with no changes to it"
You should now be able to run your notebook normally. If you need any additional assistance or have questions, please don't hesitate to reach out to us at Aqora.
Best regards,
Antoine

Hasarindu Perera

2

Posted by hasarinduperera (edited)

Thank you for your reply, I truly appreciate your help.
When I click on "Create a .venv" (step 9), my Codespace does not show an option to select an existing virtual environment. This might just be an issue on my end, so I'll try it on a fresh Codespace to see if that resolves the problem.
Regards, Hasarindu
Screenshot from 2024-11-19 21-09-37.png
PS: I tried it on a fresh Codespace, but it still did not show the existing .venv option.

Jannes Stubbemann

2

Posted by stubbi

Thanks for the feedback, @hasarinduperera! We will check the option and come back to you asap

Want to join this discussion?

Join our community today and start discussing with our members by participating in exciting events, competitions, and challenges. Sign up now to engage with quantum experts!