Microsoft Visual Studio 2015 Interactive window - python

I'm running Microsoft Visual Studio 2015 and trying to run Python 3.4 - 64-bit but the interactive window shows <disconnected>. If I try to restart it - I get the following error:
Method Not found:'Microsoft.VisualStudio.Text.SpanMicrosoft.VisualStudio.InteractiveWindow.IInteractiveWindow.WriteErro(System.String)'.
I've tried to reinstall the updated and appropriate python tool kit. I've even repaired my installation of visual studio. The interactive window is nonfunctional and I can't type anything into the window. This is true if I change the interpreter to 2.7. Configure interactive window properties doesn't have any options that will connect it to the python interpreter.
Python Debug Interactive also doesn't work and gives the same error.
Right click > Highlighting code > send to interactive, in a .py file that is open (which runs fine) also gives same error.

I believe this is because you need to install a separate interpreter (CPython, IronPython), as described here: https://github.com/Microsoft/PTVS/wiki/PTVS-Installation

Related

I wonder why python with homebrew doensn't work in VScode

I have installed python3 with homebrew, but it keeps making errors when i run.
i think problem is that i'm not working at homebrew file, so i've searched but couldn't get solutions.
which python3
give me
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
and i'm using Python 3.9.9 64-bit interpreter in /opt/homebrew/bin/python3
How can i make my VScode work with homebrew python3enter image description here?
If you focus on the terminal you can probably press arrow up to see which command Visual Studio code used to run your program. It'll probably reveal the path of the python interpreter.
I used the answer from https://stackoverflow.com/a/51488832/467650 to make Visual Studio Code run with the desired python interpreter (which also for me was the homebrew one:
I pressed ⇧⌘P, found Python: Select Interpreter and entered the full path of the python executable. After that Visual Studio Code run just fine.

Issue with Visual Studio Code and debugging Python

I am currently running on Ubuntu 20.04 with the 1.45.1 version of Visual Studio Code. I am using the Microsoft Python extension.
VS Code: 1.45.1
Python Extension 2020.5.78807
Code Runner 0.10.0
Python: 3.8.2
Pip: 20.2
I have set break points in code and activate debugging (F5). However I am unable to debug the application (again using F5). I can run using Code Runner (right click Run Code) and it successfully run but break points are never hit.
I have found no solution or workaround other than using another IDE. I am used to running in VS Code and would prefer to not have to switch IDE/editor. Any help would be appreciated.
I can debug in PyCharm or IDLE, just not VS Code.

Is there any way to use the python IDLE Shell in visual studio code?

I was programming python in Visual Studio Code and every time that I ran something it would use the integrated terminal (logically, because I have not changed any settings) and I was wondering, how could I get it to use the Python IDLE's shell instead of the integrated terminal (which for me is useless)?
I have also got Python IDLE installed in my mac but due to Visual Studio Code having "intellisense", it is way easier.
In VS Code you should be able to select the file which is supposed to be used in the terminal.
Under :
Preferences -> Settings -> Terminal

View Other Window Environment Python not available

Microsoft says this about adding Python to VS Studio;
https://learn.microsoft.com/en-us/visualstudio/python/managing-python-environments-in-visual-studio?view=vs-2019#manually-identify-an-existing-environment
Select View - Other Windows - Python Environment
I have Python 3.6 installed - I open VS Studio 2107 Community Edition, Click View - click Other - Python is not listed. I can not seem to figure out why Python Environment is not listed. Please assist
Screen Print
I figured it out. When I had originally installed the python extensions using the VS Installer, I did not run as administrator. I went back and re-ran the installer as Administrator and now it functions properly.

Visual Studio Code's PowerShell cannot find my Python

For a particular machine learning project, I needed to install Python 3.5 instead of the typical Python 3.6 I usually use. I set up my path variables such that within the command line or PowerShell, python launches my typical Anaconda Python 3.6, but python35 launches my Python 3.5 edition.
My favorite text editor / lightweight IDE to use is Visual Studio Code. However, when I use Visual Studio Code's integrated terminal to execute my Python scripts, it's unable to find my 3.5 edition.
Using Windows Powershell, things work completely fine:
However, when I attempt to access Python 3.5 within my Visual Studio Code PowerShell terminal, it can't recognize python35:
I've Google searched my the error ("the term ... is not recognized as the name of a cmdlet,..."), but every post I found on SO related to this issue (such as this one) has been about setting environment variables. I don't think this is the case here, since my normal PowerShell is able to recognize both python and python35. My suspicion is this has to do with the internal workings of the integrated terminal feature in Visual Studio Code, but I don't know enough to understand what to do next.
Does anyone know why this is happening? It's not a mission-critical issue, since I just pull up my PowerShell to execute my Python scripts, but I'd like to solve it for curiosity's sake.

Categories