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

Microsoft/VSCode - Cannot create a Python Interactive Window #584

Closed
RobinYookr opened this issue Sep 24, 2020 · 25 comments
Closed

Microsoft/VSCode - Cannot create a Python Interactive Window #584

RobinYookr opened this issue Sep 24, 2020 · 25 comments

Comments

@RobinYookr
Copy link

Hello,

Since today I am not able to create a Python Interactive Window. Whenever I try to do so, I get the message
"Connectiong to IPython kernel: Connecting to kernel." followed by "Timed out waiting to get a heartbeat from kernel process.". I have attached a log file with more information.

Logging.txt

I found the error:
"Error 2020-09-24 17:15:28: Failed to start the Daemon, StdErr: C:\Users\john van helden\Anaconda3\python.exe: can't open file '"c:/Users/john van helden/.vscode/extensions/ms-python.python-2020.9.111407/pythonFiles/pyvsc-run-isolated.py"': [Errno 22] Invalid argument"

The file is present at the specified location and the permissions of the file are good. If I click on the file, it is succesfully opened in VSCode.

System info:

  • Windows 10
  • VS Code version: 1.49.1
  • Anaconda Navigator 1.9.12
  • Python 3.7.9 64-bit ('base':conda)

Steps taken:

  • Remove Python extension in VSCode;
  • Close all VSCode instances;
  • Delete extension folder in ?/.vscode/extensions called ms-python.python-{version};
  • Open VSCode again and install Python extension;
  • Delete VSC entirely and reinstall;
  • Update all packages in Anaconda;
  • Install Python 3.8.5 and try again using this interpreter, same issue;

Looking forward to some help.

Thanks in advance!

@RobinYookr
Copy link
Author

Error:
image

File in location:
image

File permissions:
image
image

Checkboxes for 'Entire management, Editing, Reading and executing, reading, writing'.

@RobinYookr
Copy link
Author

File openend in VSC:
image

@DonJayamanne
Copy link
Contributor

@anupampydey Please could you provide the following info:

  • VS Code Version
  • Extension version
  • Logs

@greazer
Copy link
Member

greazer commented Sep 24, 2020

for engineering team: Consider not running python-run-isolated when starting the daemon. Also having spaces in the user name may be causing an issue.

Thanks @RobinYookr, we'll take a look.

@RobinYookr
Copy link
Author

  • VS Code version: 1.49.1
  • Python extension v2020.9.111407
  • Logs is attached already, see the logging.txt file.

Thank you in advance!

@RobinYookr
Copy link
Author

Regarding the spaces in the username of windwows: the Interactive Python windows has been working perfectly for the last 9 months. It stopped working since today, while no special activities (e.g. updates or whatsoever) have taken place.

@vietbub
Copy link

vietbub commented Sep 24, 2020

Please could you check and confirm the file exists.
If not, please could you uninstall the python extension & confirm the following folder has been deleted

@DonJayamanne Confirmed file existed, uninstalled Python extension and confirmed that the folder and file were removed/deleted, reinstalled the Python Extension. Same exact issue is happening

@vietbub
Copy link

vietbub commented Sep 24, 2020

Also want to add that vscode worked for most of the day on 9/23 PST. It only started having this problem around ~4 AM PST 9/24.

Just found 3.8.6 Python got released could this be an issue if I'm running on 3.8.5?

@aryvini
Copy link

aryvini commented Sep 24, 2020

Please could you check and confirm the file exists.
If not, please could you uninstall the python extension & confirm the following folder has been deleted

@DonJayamanne Confirmed file existed, uninstalled Python extension and confirmed that the folder and file were removed/deleted, reinstalled the Python Extension. Same exact issue is happening

same happening with me

@RobinYookr
Copy link
Author

Also want to add that vscode worked for most of the day on 9/23 PST. It only started having this problem around ~4 AM PST 9/24.

Just found 3.8.6 Python got released could this be an issue if I'm running on 3.8.5?

I downloaded version 3.8.6. and the problem is still there. So for me the problem arises in Python versions 3.7.9, 3.8.5 and 3.8.6.

@bcwein
Copy link

bcwein commented Sep 25, 2020

I have the same problem, updated my anaconda environment today using
anaconda update -n myenv --all
as well as updating to vscode python extension version 2020.9.111407

Only way that i could get my jupyter notebooks to work again was to downgrade the extension to the previous version as shown in the image below
bilde

@vietbub
Copy link

vietbub commented Sep 25, 2020

I can vouche that downgrading the Extension: Python resolves the issue.

To downgrade click on wrench icon and select install another version
image

@RobinYookr
Copy link
Author

Downgrading worked for me as well when I use Python 3.7.9, but not when I use 3.8.6 64-bit.

@bcwein thanks for the tip and @vietbub thanks for showing how to downgrade!

@anupampydey
Copy link

anupampydey commented Sep 25, 2020 via email

@aryvini
Copy link

aryvini commented Sep 25, 2020

I can vouche that downgrading the Extension: Python resolves the issue.

To downgrade click on wrench icon and select install another version
image

Downgrading worked for me as well,

Thanks.

@DonJayamanne
Copy link
Contributor

@bcwein @aryvini @anupampydey @vietbub @WallaceKelly
I'm sorry about this issue, i'm currently in the process of looking into this issue.
To get to the bottom of this, please could each of you provide the following:

  • Confirmation of error message (to ensure that everyone here is getting the exact same issue).
  • OS (is everyone on Windows)
  • Console logs (please go into the command Developer: Toggle Developer Tools and copy the contents from the console window

Thanks for being patient and apologies for this issue.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Sep 25, 2020

@anupampydey @vietbub I can see you have provided the logs in a separate issue. Thanks & apology for requesting this once again.
https://github.com/microsoft/vscode-python/issues/14082

@DonJayamanne
Copy link
Contributor

More information & logs here:
microsoft/vscode-python#14097 (comment)

@rchiodo
Copy link
Contributor

rchiodo commented Sep 25, 2020

I can repro in house. If the user name has a space, it looks like just kernel launching is failing.

@WallaceKelly
Copy link

@DonJayamanne It actually is not happening for my machine. It is happening for one of my students. But, I recall that she is using Windows and her user path includes a space between her first and last name. I even speculated to her that might be the problem.

@rchiodo
Copy link
Contributor

rchiodo commented Sep 25, 2020

Internal: To repro simple clone the vscode-python repo into a source directory with a space. We should add a test for this.

@bcwein
Copy link

bcwein commented Sep 25, 2020

As requested, @DonJayamanne

I can confirm that i am using windows 10 (build 19041).

I installed Extension: Python to version 2020.9.111407 and can confirm that i have the error
bilde

As @rchiodo mentioned. This error occurs if user name has space and i can confirm that my username contains a space.

Console log below:

mainThreadExtensionService.ts:66 TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
at validateString (internal/validators.js:112:11)
at Object.extname (path.js:752:5)
at showNotification (c:\Users\Bjørn Christian.vscode\extensions\kiteco.kite-0.123.0\dist\kite-extension.js:31:16472)
at c:\Users\Bjørn Christian.vscode\extensions\kiteco.kite-0.123.0\dist\kite-extension.js:1:24452
at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:46:475)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:821:892
at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:46:475)
at b.acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:699:482)
at b.$acceptDocumentsAndEditorsDelta (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:697:401)
at g._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:860:464)
at g._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:860:156)
at g._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:858:817)
at g._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:857:623)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:855:691
at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:46:475)
at v.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:256:381)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:1047:649
at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:46:475)
at v.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:256:381)
at t.PersistentProtocol._receiveMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:261:451)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:258:489
at l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:46:475)
at p.acceptChunk (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:253:851)
at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:253:203
at Socket.t (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:263:54)
at Socket.emit (events.js:223:5)
at addChunk (_stream_readable.js:309:12)
at readableAddChunk (_stream_readable.js:290:11)
at Socket.Readable.push (_stream_readable.js:224:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:181:23)
webviewElement.ts:152 [Embedded Page] Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/Microsoft/monaco-editor#faq
webviewElement.ts:152 [Embedded Page] Failed to construct 'Worker': Script at 'vscode-webview-resource://73f8ac95-a98c-4293-b8ac-962254fb0d75/file///c%3A/…ython/Uis-intro-python/Notebooks/Python_for_data_analysis/editor.worker.js' cannot be accessed from origin 'vscode-webview://73f8ac95-a98c-4293-b8ac-962254fb0d75'.
2
notificationsAlerts.ts:40 Timed out waiting to get a heartbeat from kernel process.
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: Timed out waiting to get a heartbeat from kernel process.
console.ts:137 [Extension Host] stack trace: Error: Timed out waiting to get a heartbeat from kernel process.
at f.waitForHeartbeat (c:\Users\Bjørn Christian.vscode\extensions\ms-python.python-2020.9.111407\out\client\extension.js:56:573516)
mainThreadExtensionService.ts:65 [[object Object]]Timed out waiting to get a heartbeat from kernel process.
mainThreadExtensionService.ts:66 Error: Timed out waiting to get a heartbeat from kernel process.
at f.waitForHeartbeat (c:\Users\Bjørn Christian.vscode\extensions\ms-python.python-2020.9.111407\out\client\extension.js:56:573516)

@vmhung93
Copy link

It took me about 2 days to figure out how to fix it. To resolve this issue: I downgraded the Python Extension to the previous version 2020.8.109390 and it works fine.

@hathawayj
Copy link

I have a student on a windows computer that is having a similar issue. I am on a MacBook pro and I now cannot connect to the kernel. I tried downgrading my extension version and it did not help.

@rchiodo
Copy link
Contributor

rchiodo commented Oct 1, 2020

This should be fixed now.

@rchiodo rchiodo closed this as completed Oct 1, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 11, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests