microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.53k stars 676 forks source link

Unable to run Python code line by line from VIsual Studio 2022. #7991

Open vsfeedback opened 1 week ago

vsfeedback commented 1 week ago

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work] [regression] [worked-in:Visual Studio2019] The operating environment is Windows 11 Pro and Visual Studio Community 2022.

Partial execution using cursor and "Ctrl+Enter" is not possible. Even if you press Edit > Send to Interactive with part of the code selected, the window does not update as shown below. - ”Python 3.1 (64-bit) Interactive Window [PTVS 17.0.24138.2-17.0] Type $help to see a list of commands. ”

The shortcut keys remain as default.

I set up the development environment using Anaconda's Python, referring to the official tutorial.

I've been using Visual Studio Community 2019 on Windows 10 Pro, but I didn't have any problems like this.


Original Comments

Feedback Bot on 8/27/2024, 02:37 AM:

(private comment, text removed)


Original Solutions

(no solutions)

yuki-motohashi commented 6 days ago

#Added on September 11, 2024

The main reason was that Visual Studio 2022 did not support Anaconda 3.

Here is an environment that works correctly instead. 【C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\】

If you saw this, please also check the settings below.

【Tools > Options > Keyboard】 Type "edit" in the search field to open a list of shortcut keys. If you find "Ctrl+Enter" assigned to something other than "Send to Interactive", please delete it.

I wish you good luck.