Julia kernel not respecting environment selection
See original GitHub issueEnvironment 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]
- Install Julia
- In Julia:
import Pkg
Pkg.add("IJulia")
Pkg.add("Conda")
import Conda; Conda.add("ipython")
]
to get to Pkg mode, prompt should reflect v1.6 environmentbuild
- (At this point, I believe Jupyter kernel should now be available for connection)
- still in Pkg mode:
activate cas
- (At this point a new environment folder has been created)
add SymPy
- (At this point, cas environment, not the v1.6 environment, should have SymPy installed. Verify with st command.)
- In VSCode, add new notebook, set for Julia.
1+1
(should return2
)using SymPy
(returns LoadError – this is expected)- select cas environment via UI in status bar … probably located under user folder
using SymPy
(returns LoadError – this is the problem)- Open new Julia shell. Type
]
for Pkg mode. Prompt should show v1.6 environment. st
to confirm SymPy not presentadd SymPy
; verify withst
- Repeat starting at (11). Lines 13 and 15 should both succeed.
@vars x y
should return(x, y)
- while in the cas environment in VSCode,
import Pkg; Pkg.remove("SymPy")
- 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
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
how do I configure IJulia kernel to use specific environment?
In the notebooks I would like to import library , and install its dependencies within its own evironment. Following the sugestions here, I...
Read more >Can't restart kernel in VSCode jupyter notebook - VS Code
6, I created a new environment, but the notebook does not seem to respect the chosen environment from VSCode, according to Julia kernel...
Read more >1. Setting up Your Julia Environment
Overview¶. In this lecture we will cover how to get up and running with Julia. While there are alternative ways to access Julia...
Read more >Working with Jupyter code cells in the Python Interactive window
To select an environment, use the Python: Select Interpreter command from the Command ... Run Above applies to all the code cells up...
Read more >Installation · Documentation - Interpretable AI
Install Julia and the IAI system image manually, which is a more involved process but ... make sure you select the version that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll open an issue on their end and xref.
I believe @davidanthoff addressed this in the julia extension.