-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Environment data
- VS Code version: 1.33.1
- Extension version (available under the Extensions sidebar): 2019.3.6558
- OS and version: Microsoft Windows 10.0
- Python version (& distribution if applicable, e.g. Anaconda): Anaconda 3.6.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Tried both default base above, and new, clean Anaconda python 3.7.3 environment, same error in both
- Relevant/affected Python packages and their versions: jupyter 1.0.0
Expected behaviour
Jupyter server starts and runs. I have not used VS code for the last month. Previously I used jupyter interactive cell mode in .py files via Don Jayamanne's Jupyter extension, everything worked fine. On opening VS code this morning I allowed it to install update to version 1.33.1, and then noted the warning re the Jupyter extension being deprecated, so disabled that package. The new problem occurs trying to work interactively with the new python extension.
I tried re-enabling and running the old Jupyter extension, however that fails, with error related to previewHTML, which I assumed fell under the banner of the extension being no longer supported. The combination of the two means my usual workflow is now completely inoperable.
Actual behaviour
Anything that requires starting the jupyter server or python interactive window (eg. Clicking on 'Run cell' in .py file, selecting 'Show Python Interactive Window' or 'Run Selection/Line in Python Interactive Window') causes the following error notification to pop-up:
Activating Python 3.6.4 64-bit ('base': conda) to run Jupyter failed with Error: StdErr from ShellExec, Access is denied.
The system cannot find the file specified.
Could Not Find C:\Program Files\Microsoft VS Code\temp.txt
Access is denied.
The system cannot find the file specified.
Could Not Find C:\Program Files\Microsoft VS Code\temp.txt.
One thing I noticed: if I select a line and hit 'Shift+Enter' so it runs in the ipython terminal, in the bunch of commands that appear in the terminal window (presumably triggered by whatever internal VS python extension script is being) prior to the iPython terminal launching for the first time, the following are the first 4:
C:/Anaconda3/Scripts/activate
python C:\Anaconda3\etc\keras\load_config.py 1>temp.txt
set /p KERAS_BACKEND= 0<temp.txt
del temp.txt
AFAICT this just a means to set an environment variable with the Keras backend - but the fact it was trying to do this via writing to and from temp.txt made me wonder if something similar was being initiated in jupyter server launcher, which was failing bacuse the working directory for VS code (C:\Program Files\Microsoft VS Code) is write protected.
Steps to reproduce:
- Open visual studio code
- Create a file test_jupyter.py, with lines:
#%%
print('Hello')
- Click 'Run cell'
OR
- Open visual studio code
- Open command pallette and select 'Python: Show Python Interactive window'
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Jedi Python language engine.
##########Linting Output - pylint##########
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
Python Extension: getActivatedEnvironmentVariables, Class name = b, Arg 1: undefined, Arg 2: {"architecture":3,"path":"C:\\Anaconda3\\python.exe","version":{"raw":"3.6.4-final","major":3,"minor":6,"patch":4,"prerelease":["final"],"build":[],"version":"3.6.4-final"},"sysPrefix":"C:\\Anaconda3","fileHash":"2706b186a4d0a2e33818a0350c54fd24995fa8855d66ae99f6e916bc0006323a77b017071861b61e86321f075287cbba7ea27ffc18157ee3f590b7e065c7428f","companyDisplayName":"Anaconda, Inc.","type":"Conda","envName":"base","envPath":"C:\\Anaconda3","displayName":"Python 3.6.4 64-bit ('base': conda)"}, Arg 3: true Error: StdErr from ShellExec, Access is denied.
The system cannot find the file specified.
Could Not Find C:\Program Files\Microsoft VS Code\temp.txt
Access is denied.
The system cannot find the file specified.
Could Not Find C:\Program Files\Microsoft VS Code\temp.txt
at b.<anonymous> (C:\Users\momeemb2\.vscode\extensions\ms-python.python-2019.3.6558\out\client\extension.js:83:594490)
at Generator.next (<anonymous>)
at s (C:\Users\momeemb2\.vscode\extensions\ms-python.python-2019.3.6558\out\client\extension.js:83:592836)