question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter keeps running the 'base' conda environment

See original GitHub issue

Issue Type: Bug

I have a specific conda environment ‘my_env’.

I can select it to be used as a kernel, in the top right of the notebook, with “Jupyter Server: local”.

But, when I try to execute code in the notebook, such as os.getenv('CONDA_DEFAULT_ENV') it still says it’s using the ‘base’ environment, and can’t find the installed packages.

Bottom left of VS Code says the interpreter is Python…(‘my_env’). When I open a new terminal it activates ‘my_env’ but the kernel keeps running ‘base’.

This used to work well, but now it’s broken.

Extension version: 2021.2.576440691 VS Code version: Code 1.53.2 (622cb03f7e070a9670c94bae1a45d78d7181fbd4, 2021-02-11T11:48:44.518Z) OS version: Linux x64 5.8.0-43-generic snap

System Info
Item Value
CPUs Intel® Core™ i7-8565U CPU @ 1.80GHz (8 x 2932)
GPU Status 2d_canvas: unavailable_software
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
protected_video_decode: disabled_off
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
Load (avg) 3, 3, 3
Memory (System) 15.49GB (1.72GB free)
Process Argv –force-user-env --no-sandbox --unity-launch --no-sandbox --crash-reporter-id e0b4888e-7039-4296-a9e5-65e00d3fce86
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspyt653:30253241
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry244:30256636
pythonvsdeb440:30248342
pythonvsded773:30248341
vstes627:30244334
pythonvspyt875:30259475
dockersubsetcf:30263000

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
lucasfijencommented, Mar 3, 2021

Thanks for filing this issue, we have seen a few reports related to conda. Please could you revert your Python extension to a version from December, I’d like to check if that fixes it. To install an older version just go to the extensions tab & click the gear icon & select Install Another Version, see here Screen Shot 2021-02-25 at 07 19 59

Finally: Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to debug
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel.

Thanks

Having the same problem, python interactive only selecting the base kernel. For me downgrading the jupyter extension instead of the python extension fixed the problem, the problem starts from jupyter extension 2021.2.0 for me.

1reaction
JunCEEEcommented, Mar 25, 2021

@DonJayamanne Thanks for your efforts. I just tested the latest Jupyter extension in VS Code Insiders, and the problem is resolved. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get Your Conda Environment to Show in Jupyter Notebooks
1. First, install nb_conda_kernels in your base environment. Once this is installed any notebook running from the base environment will ...
Read more >
Jupyter notebook only works in base environment
I have reinstalled Anaconda and Jupyter, restarted PC and used ip 127.0.0.1 instead of localhost, but nothing helps. What should I do? I...
Read more >
Conda always pointing to base environment regardless the ...
when i run the command “conda env list” on jupyter notebook it is always pointing to the base environment which is wrong. !conda...
Read more >
Jupyter will not change environments when using conda #4011
Changing conda environment at bottom left corner or python interpreter at top right corner does not changing the contents of sys.exeutable.
Read more >
What to do when things go wrong - The Jupyter Notebook
If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found