profile
viewpoint

Ask questionsExtension is returning "r.stat is not a function" when starting a Jupyter notebook

Bug: Notebook Editor, Interactive Window, Editor cells

<!----------------------------------------------------------------------------------------------- PLEASE READ If this issue doesn't relate to Jupyter Notebooks, Python Interactive Window features or other notebook or "cell"-based features of the Python extension, please use the main Python bug template instead of this one. Thank you! ------------------------------------------------------------------------------------------------->

Steps to cause the bug to occur

This is all I've done:

  1. Opted in run by line experiment and the Insiders build
  2. Selected a Python 3.8 venv with jupyter installed (Python from Windows store, might be relevant)
  3. Opened a blank notebook

Actual behavior

image

<!----------------------------------------------------------------------------------------------- Animated GIFs can be effective means to describe a bug. Consider using a tool like https://github.com/phw/peek or https://www.screentogif.com/ to create one. ------------------------------------------------------------------------------------------------->

Your Jupyter and/or Python environment

Please provide as much info as you readily know

  • Jupyter server running: Local
  • Extension version: 2020.7.86945-dev
  • VS Code version: 1.46.0
  • Python and/or Anaconda version: 3.8
  • OS: Windows
  • Virtual environment: venv
  • jupyter --version:
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : 4.7.4
ipython          : 7.15.0
ipykernel        : 5.3.0
jupyter client   : 6.1.3
jupyter lab      : not installed
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.7
traitlets        : 4.3.3

Developer Tools Console Output

<!----------------------------------------------------------------------------------------------- Copy/paste the output in the "Console" tab in the "Developer Tools" panel (Help > Toggle Developer Tools). For better details, run the "Enable source map support for extension debugging" command in VS Code at least once beforehand. ------------------------------------------------------------------------------------------------->

Output window

User belongs to experiment group 'RunByLine - experiment'
User belongs to experiment group 'ShowPlayIcon - start'
User belongs to experiment group 'DebugAdapterFactory - experiment'
User belongs to experiment group 'PtvsdWheels37 - experiment'
User belongs to experiment group 'UseTerminalToGetActivatedEnvVars - control'
User belongs to experiment group 'LocalZMQKernel - control'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
User belongs to experiment group 'EnableIPyWidgets - experiment'
User belongs to experiment group 'CustomEditorSupport - control'
> conda --version
> pyenv root
> python3.7 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3.6 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python3 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python2 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.7 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3.6 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -3 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> py -2 c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> conda info --json
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
> python c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import sys;print(sys.executable)"
Python interpreter path: .\env38\Scripts\python.exe
Starting Jedi Python language engine.
> conda --version
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import jupyter"
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
> ~\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import notebook"
> c:\Users\luabud\Apps\sample-notebook\env38\Scripts\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py -c "import ipykernel"
> ~\AppData\Local\Microsoft\WindowsApps\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v
> ~\AppData\Local\Microsoft\WindowsApps\python.exe c:\Users\luabud\.vscode\extensions\ms-python.python-2020.7.86945-dev\pythonFiles\pyvsc-run-isolated.py vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_launcher_daemon -v

Developer Tools

rstaterror.txt

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

microsoft/vscode-python

Answer questions luabud

Sorry that it took me forever to reply to this!

You're right Ian, I could not start a Jupyter server from that environment. FWIW the path that was set into the HOME key on the pyvenv.cfg was this one: C:\Users\luabud\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe And it seems that pip isn't available in this environment, so I guess something funky happened when I created it.

I'm using a new virtual environment so things are working well now 😊

useful!

Related questions

Auto Scroll in the Jupyter output hot 3
Workspace contains pipfile but pipenv --venv failed hot 2
Can you turn off the Microsoft Python Language Server? hot 2
Unable to debug Python tests (duplicate entries in &#34;env&#34;) hot 2
Jupyter server crashed. Unable to connect. Cannot assign requested address hot 2
Auto Scroll in the Jupyter output hot 2
Unable to run launch targets with newest VS Code Python extension hot 2
Unable to start jupyter python interactive window hot 1
HBox output is not shown correctly in the interactive window hot 1
Debug -> Add Debug Configuration 'Cannot read property openConfigFile' hot 1
VSCode cannot connect to jupyter server; with browser this works fine hot 1
Linux arm64/aarch64 support hot 1
Add setting to disable icon for "Run Python File In Terminal" hot 1
Extension Host keeps crashing hot 1
Activate environment before debugging tests hot 1
Github User Rank List