Skip to content

Julia kernel not respecting environment selection #5666

@deoradh

Description

@deoradh

Environment data

  • VS Code version: 1.56.0-insider
  • Jupyter Extension version (available under the Extensions sidebar): 2021.6.790799743
  • Python Extension version (available under the Extensions sidebar): XXX
  • OS (Windows | Mac | Linux distro) and version: Win10 21H1 (19043.962)
  • Python and/or Anaconda version: (Conda pkg from Julia)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A?
  • Jupyter server running: Local

Expected behaviour

When using a Julia notebook, having selected a Julia environment, available packages should reflect that environment, and adding/removing packages should affect only that environment.

Actual behaviour

Only the default (eg, "v1.6") environment is used. The selected environment is indexed, but commands are not run against it.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Install Julia
  2. In Julia: import Pkg
  3. Pkg.add("IJulia")
  4. Pkg.add("Conda")
  5. import Conda; Conda.add("ipython")
  6. ] to get to Pkg mode, prompt should reflect v1.6 environment
  7. build
  8. (At this point, I believe Jupyter kernel should now be available for connection)
  9. still in Pkg mode: activate cas
  10. (At this point a new environment folder has been created)
  11. add SymPy
  12. (At this point, cas environment, not the v1.6 environment, should have SymPy installed. Verify with st command.)
  13. In VSCode, add new notebook, set for Julia.
  14. 1+1 (should return 2)
  15. using SymPy (returns LoadError -- this is expected)
  16. select cas environment via UI in status bar .. probably located under user folder
  17. using SymPy (returns LoadError -- this is the problem)
  18. Open new Julia shell. Type ] for Pkg mode. Prompt should show v1.6 environment.
  19. st to confirm SymPy not present
  20. add SymPy; verify with st
  21. Repeat starting at (11). Lines 13 and 15 should both succeed. @vars x y should return (x, y)
  22. while in the cas environment in VSCode, import Pkg; Pkg.remove("SymPy")
  23. In Julia shell's Pkg mode, st should now show SymPy removed from v1.6 environment, yet remains in cas environement. This is the problem, again.

Logs

> ~\AppData\Local\Programs\Julia-1.6.1\bin\julia.exe -i --color=yes --project=@. ~\.julia\packages\IJulia\e8kqU\src\kernel.jl ~\AppData\Local\Temp\tmp-26076Hwwked5aynhv.json
cwd: ~\AppData\Local\Programs\Microsoft VS Code Insiders

Metadata

Metadata

Assignees

No one assigned

    Labels

    language-anyArea covering general issues geared to supporting any language (not just Python)partner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions