Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected Kernel does not point to the right interpreter #5489

Closed
DonJayamanne opened this issue Apr 12, 2021 · 10 comments
Closed

Selected Kernel does not point to the right interpreter #5489

DonJayamanne opened this issue Apr 12, 2021 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel)

Comments

@DonJayamanne
Copy link
Contributor

Originally reported by @muser840
#5214 (comment)

Just to confirm that Jupyter uses the wrong python, which is confirmed by

import sys
print(sys.executable)
! which python

For me the output of the above prints:

/usr/bin/python3
/home/user/venv/bin/python

It should be the same! These is some mess with switching between python versions by the extension. Somehow switching to old and already deleted environments make it work. That makes extension totally unusable...

The problem is present on versions:
v2021.5.702919634
v2021.6.732501275

update: sometimes it randomly starts to work...

@DonJayamanne DonJayamanne added the bug Issue identified by VS Code Team member as probable bug label Apr 12, 2021
@DonJayamanne
Copy link
Contributor Author

@muser840

Please could you provide the following information:

  • VS Code version: XXX
  • Jupyter Extension version (available under the Extensions sidebar): XXX
  • Python Extension version (available under the Extensions sidebar): XXX
  • OS (Windows | Mac | Linux distro) and version: XXX
  • Python and/or Anaconda version: XXX
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): XXX
  • Attempt to repro the issue & then copy the output from the Jupyter output panel.

@DonJayamanne DonJayamanne self-assigned this Apr 12, 2021
@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel) labels Apr 12, 2021
@bardal
Copy link

bardal commented Apr 22, 2021

I think I see the same issue:

Version: 1.55.2 (system setup)
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:35:57.887Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 6.1.7601
Jupyter Extension : v2021.5.745244803
Python 3.8.6 64-bit
Environment: venv

With venv selected - Jupyter Notebook output:

import sys
print(sys.version)
print(sys.executable)
3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
C:\Program Files\Python38\python.exe

Command line - same venv activated:

(reporting-env) D:\projects\utils>python
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
D:\projects\reporting-env\Scripts\python.exe

@DonJayamanne
Copy link
Contributor Author

@bardal Thanks for the feedback:

  • Are you using notebooks or interactive window?
  • Please could you re-load VS Code, run the same code in a cell and prvide the following:
    • Cell Output
    • Output from the Jupyter output panel (you might have to copy th eoutput to a text file & upload that text file)
    • What kernel did you pick (i.e. what were you expecting to see)
    • Screenshots
      • With the cell output
      • With the kernel displayed in the bottom right

I'm sorry you're running into this and would appreciate the replying with the above info, I'd like to unblock you and others running into this.

@bardal
Copy link

bardal commented Apr 24, 2021

I am loading a .ipynb in Visual Studio Code - not sure if that means notebooks or interactive window!

Jupyter Cell:
import sys
print(sys.version)
print(sys.executable)

3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)]
C:\Program Files\Python38\python.exe

I selected reporting_env as the kernel

Screenshot and Jupyter output panel screenshot:

jupyter screenshot

jupyter_log.txt

@DonJayamanne
Copy link
Contributor Author

DonJayamanne commented Apr 24, 2021

Thanks for the information,
Is reporting_env a conda environment?

not sure if that means notebooks or interactive window!

This is a notebook. Thanks

@bardal
Copy link

bardal commented Apr 24, 2021

reporting_env is a standard Python venv (not conda).

@DonJayamanne
Copy link
Contributor Author

Thanks for providing the information.

@DonJayamanne DonJayamanne removed the info-needed Issue requires more information from poster label Apr 26, 2021
@bardal
Copy link

bardal commented May 1, 2021 via email

@DavidKutu
Copy link

Still reproes
image

@IanMatthewHuff
Copy link
Member

Validated. Lots of different ways to set up environments, but works with my venv.
image.png

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-execution Kernels issues (start/restart/switch/execution, install ipykernel)
Projects
None yet
Development

No branches or pull requests

4 participants