You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Debugging a Mojo project with Python dependencies is broken when VS Code is started from a Snap icon in Ubuntu. Also, regardless of how VS Code is started, clicking on Run Mojo File from the IDE's dropdown menu doesn't work until I run magic shell in the VS Code terminal.
Initially I could not use the Mojo debugger with my project which uses Python with dependencies installed from Conda and PyPi. I added these dependencies to the project's mojoproject.toml file using the magic add command. Within the VS Code IDE I've found that for my project to find these Python dependencies, I must execute the magic shell command in the terminal before clicking on the Run Mojo File in the IDE's dropdown menu.
When I try and run the debugger, VS Code does not respect the local Python environment in the active terminal after I've run the magic shell command, so the dependencies are missing.
After discussion in Discord with Ehsan M. Kermani.
I get the following behavior when I run magic shell then start VS Code from within a bash shell (see 1, 2, & 3 below).
In short, starting this way from the CLI allows me to use the debugger from within VS Code (2 & 3 below), but it's not intuitive and doesn't resolve item 1.
Click on Run Mojo File - KO
Must run magic shell in the VS Code terminal for this command to work.
Same behavior regardless of how I start VS Code, from bash shell or Snap icon.
Click on Debug Mojo File - OK
The sequence above uses the correct, local project Python environment.
When I start VS Code from the Snap icon, it's terminal uses the wrong Python environment.
Click on Debug Mojo File in Terminal - OK
Same as 2 above.
System information
- Ubuntu 24.10
- VS Code v1.95.2
- VS Code extension = Mojo Nightly v2024.11.1405
- mojo 2024.11.1405 (d5d02e71)
- max 2024.11.1405 (d5d02e71)
- Modular version 2024.11.1405
The text was updated successfully, but these errors were encountered:
Bug description
Discord: https://discord.com/channels/1087530497313357884/1306643450065719326
Debugging a Mojo project with Python dependencies is broken when VS Code is started from a Snap icon in Ubuntu. Also, regardless of how VS Code is started, clicking on
Run Mojo File
from the IDE's dropdown menu doesn't work until I runmagic shell
in the VS Code terminal.Initially I could not use the Mojo debugger with my project which uses Python with dependencies installed from Conda and PyPi. I added these dependencies to the project's
mojoproject.toml
file using themagic add
command. Within the VS Code IDE I've found that for my project to find these Python dependencies, I must execute themagic shell
command in the terminal before clicking on theRun Mojo File
in the IDE's dropdown menu.When I try and run the debugger, VS Code does not respect the local Python environment in the active terminal after I've run the
magic shell
command, so the dependencies are missing.Before magic shell
After magic shell
Steps to reproduce
After discussion in Discord with Ehsan M. Kermani.
I get the following behavior when I run
magic shell
then start VS Code from within a bash shell (see 1, 2, & 3 below).In short, starting this way from the CLI allows me to use the debugger from within VS Code (2 & 3 below), but it's not intuitive and doesn't resolve item 1.
Run Mojo File
- KOmagic shell
in the VS Code terminal for this command to work.Debug Mojo File
- OKDebug Mojo File in Terminal
- OKSystem information
The text was updated successfully, but these errors were encountered: