简体   繁体   English

vscode python interactive window timed out on running python script on other conda environment 除了基础环境

[英]Vscode python interactive window timed out on running python script on other conda environment apart from base environment

In vscode, While running my python script on interactive python window in other conda environment (apart from base environment), I get the following error - 'Timed out waiting to get a heartbeat from kernel process.'在 vscode 中,在其他 conda 环境(除了基本环境)中的交互式 python window 上运行我的 python 脚本时,我收到以下错误 - '等待从 kernel 进程获取心跳超时。

Script works fine in base environment but not in other envrionments.脚本在基本环境中运行良好,但在其他环境中运行不佳。 Also, this is specific for python interactive window. It works fine in terminal.此外,这特定于 python 交互式 window。它在终端中运行良好。

Has anyone faced this issue as well?有没有人也遇到过这个问题?

According to your description, code works fine in base environment and terminal, while got error in other conda and interactive window. So try to solve the problem with following steps:根据您的描述,代码在基础环境和终端中运行良好,而在其他 conda 和交互式 window 中出现错误。因此尝试通过以下步骤解决问题:

  1. Create a new conda environment, reference: python-environments新建conda环境,参考: python-environments
  2. To use the window with a.py file, select the Run Current File in Python Interactive window command from the Command Palette.要将 window 与 .py 文件一起使用,select 命令面板Run Current File in Python Interactive window More information and details you can reference: python-interactive.更多信息和细节你可以参考: python-interactive。
  3. Here you'll get the output. The following is a demo screenshot.在这里你会得到output。以下是演示截图。 在此处输入图像描述

Considering your question is related to python extension, if the above not work, reinstall python extension and try again.考虑到您的问题与 python 扩展有关,如果上述方法无效,请重新安装 python 扩展并重试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM