简体   繁体   English

VS Code“在Python交互式窗口中运行选择/行”根本不起作用

[英]VS Code "Run selection/line in Python interactive window" not working at all

On a new install of VS Code on a new machine I have come across this error.在新机器上新安装 VS Code 时,我遇到了这个错误。

The send to python interactive window functionality is behaving exceptionally weirdly.发送到 python 交互式窗口功能的行为异常奇怪。

It will: - Send a single line of code to the interactive window using either shift+enter or right-click and select, when the cursor is on that line.它将: - 当光标位于该行上时,使用 shift+enter 或右键单击并选择一行代码发送到交互式窗口。

It will not: - Send any code to the interactive window when code is selected (by highlighting) either through shift+enter or right click and select.它不会: - 当通过 shift+enter 或右键单击并选择代码(通过突出显示)时,将任何代码发送到交互式窗口。

I have ticked the box is settings marked "Python > Data Science: Send Selection To Interactive Window".我勾选了标记为“Python > 数据科学:将选择发送到交互式窗口”的设置框。

Anyone else experienced this problem or have suggestions to fix it?有没有其他人遇到过这个问题或有解决它的建议?

VS Code version: 1.14.1 VS 代码版本:1.14.1

Python version: 3.7.4 Python版本:3.7.4

Python VS code extension: 2020.1.57204 Python VS 代码扩展:2020.1.57204

After some searching i have found that there is an issue with the Python VS COde Extension Version 202.1.57204.经过一番搜索,我发现 Python VS COde 扩展版本 202.1.57204 存在问题。

The solution to this is to install the previous version in VS Code (209.11.50794).解决方法是在 VS Code (209.11.50794) 中安装之前的版本。

To do this go to the extensions tab on the left side, right click on the "Python" extension and select "Install another version...".为此,请转到左侧的扩展选项卡,右键单击“Python”扩展并选择“安装另一个版本...”。 Any previous version should work but i chose the most recent before 2020.1.507204.任何以前的版本都应该可以使用,但我选择了 2020.1.507204 之前的最新版本。

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

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