When I create Magic environments, my Mojo projects (using external Packages) are executed over the console reliably. However, VSCode presents the following issues:
It only detects the default MAX SDK (stable)
My magic environment (via magic shell) is not recognized, yielding:
Community Packages (via magic add …) show as unresolved imports, i.e. parsing errors
Cannot use Jupyter notebooks (no MAX kernels detected)
System: MacOS (Apple Silicon)
What am I doing wrong? How can I get VSCode to recognize my magic environment with all the installed packages? Does anyone else have issues with that as well?
I must have had this issue for as long as I have been using Magic. However, I did not notice it at all, since I neither tried to use external Mojo packages nor tried to create a Mojo notebook…
Hey @TilliFe. I reported the problem about community packages to our engineers recently. We’re working on adding support. The Magic environment issue is also known and being addressed sometime soon.
just had the same problem on a mac and also followed the advice on how to force vscode to adopt the environment form the cmd. nothing work. had to issue “magic shell” in the vs code terminal.
The same or a related issue happens when following the tutorial strictly. when following step 13: Get started with Mojo | Modular : magic add “python>=3.11,<3.13” “pygame>=2.6.1,<3”
The terminal environment and vscode lost the environment . Had to issue magic shell again , restart vscode and issue magic shell in its terminal
The work without any problem when using conda!
Frustrating but not a big issue when you know what to do. Maybe update the tutorial as follows:
if you loose the environment “life” then go to the folder life run “magic shell” also in vscode