I'm used to use VS to code C++ and Eclipse to code python but lately I have tried VS for both languages.
I found something very difficult to understand that while VS autocompletes it doesn't warn you about errors before runtime.
There is no warning regarding non existent variables or methods. I can't believe that VS does not warn about this kind of typical coding issues as it does for C++ code (as every IDE does).
What am I missing?
I tested this with VS2013 and VS2015.
I'm expecting something like:
Thanks
In order to get the python detailed IntelliSense support in VS2015 you have to install python tools for visual studio which provide the following:
CPython, PyPy, IronPython and more
Detailed IntelliSense
Interactive debugging
Integrated with Visual Studio features
Free and open-source
And the best thing, it's completely free.
Just download it from here:
https://www.visualstudio.com/en-us/features/python-vs.aspx
I hope it supports your question.
Update after comment:
You just need to refresh the Database. It works for me. Check to make sure the environment options are set (specifically path variable to PYTHONPATH) and the DB is refreshed.
Sometimes Deleting the __init__.py file in my source root directory did the trick
It seems that with a regular Python installation (2.x or 3.x in 32bit or 64bit) there are limited "warnings" (hovering over an undefined variable gives "unknown type"), but Syntax Highlighting / Intellisense doesn't seem to work.
Intellisense NOT Working:
Getting Intellisense to Work:
After some research I tried installing another Python interpreter for Visual Studio to work with. I went with Iron Python because it is "tightly integrated with the .NET Framework".
Download it from here --> http://ironpython.codeplex.com/downloads/get/970325
After installing IronPython open Visual Studio and set it as the "Default Environment for New Projects". You can set it in "Tools" --> "Python Tools" --> "Python Environments" (or by pressing Ctrl + K + `)
Make sure to refresh the database and Syntax Highlighting will start working. It doesn't seem very thorough, but it is there.
See photo below:
Related
I have Anaconda installed in my system and personally use jupyter notebook for my development. The problem is I want to debug my code with a visual debugger which jupyter doesn't support Reference.
Could you introduce some tool which gives full visual debugging experience and also works well with Anaconda?
This one seems appropriate to me but as mentioned in the comments, It's problematic in windows 10.
I recommend VSCode. I'm using it myself with anaconda and python interactive files, plus full debugging experience is available. In my opinion, it's the best IDE for DS with python (see link).
I am fairly new to python. So I installed python and my editor is Visual Studio Code. The Intellisense seems to work for this code (extension BeautifulSoup):
enter image description here
But it doesn't work for this:
enter image description here
I tried to restart my computer, but it didn't help.
I have also tried to use virtual enviroments and I also selected the right associated interpreter. To use python in Visual Studio Code, I installed following extensions:
MagicPython
Pylance
Python
Python Extension Pack
Visual Studio IntelliCode
Do you have any Idea why my Intellisense is not working for packages?
In VS Code, the "Intellisense" function of Python code is provided by the the Python extension, and the language service provided by "Pylance" provide us with docsing content.
Therefore, it is recommended that you "disable" other extensions to avoid interference between them and affect the use of the "Intellisense" function.
In addition, if it still doesn't work, please reinstall the Python extension and reload VS Code.
When start debug from Visual Studio, it takes like 2 minutes to hit the first line of python code. Apparently Visual Studio is busy loading python modules.
python.exe' (Win32): Loaded 'C:\ProgramData\Anaconda3\python.exe'. Symbols loaded.
'python.exe' (Win32): Loaded 'xxxxx'. Cannot find or open the PDB file.
... many more ...
I tried below, no joy:
Tools \ Options \ Debugging
a) Enable Just My Code checked
b) Just-In-Time Debugging - only selected Managed and Script
c) Symbols
unchecked "Microsoft Symbol Servers"
"Load all modules, unless excluded" or "Load only specified modules" (tried both)
https://devblogs.microsoft.com/devops/make-debugging-faster-with-visual-studio/
Reinstall Visual Studio (I tried both Community Edition, Standard Edition)
Reboot my machine three times
Delete all breakpoints
Disable Resharper
Two more observations:
I never had this issue prior to today
Python Interactive Debugger stopped working today - it refuse to print anything!
myDataFrame.head()
print("hello")
Fixed!!
I deleted my Visual Studio solution and project file. Create the python project brand new, all fixed!
Just in case anyone else is looking around,
I also had horrendous debug times (2+ minutes to get to the first line of code).
I was using an Anaconda deployment for numpy/scipy along with pybind11 to interface/debug C code.
I fixed my debug times by using a vanilla deployment of python (3.9.1) and installing the minimal requirements using pip. I believe it was taking so long because visual studio is searching for debug symbols that do not exist. Anaconda does not provide symbol libraries (nor will they according to their forums)
Debug times are now as fast as normal run times (<1s) and I'm no longer dreading hitting the little bug button.
To disable "Enable native code debugging" in the solution properties helped for me.
I installed ms-python.python. Normally I use Atom and I switch to VS Code for trying.
I have 2 questions :
I set linter to flake8 : Is it possible to verify in real time like Atom the python syntax or only possible when I save the file ?
Also, Atom show the content of vars : vars in Atom. There is a way to do the same thing on Visual Studio Code ? vars in VSC
Linting on change is not implemented, but there is a feature request for it
I have no issues seeing attributes, but I'm running on the development build of the extension so whatever issue you're running into may not be publicly released quite yet
I am currently using Pycharm. What I like about PyCharm are the following:
Simplicity of creating virtualenvs
Intellisense
GUI package installer
Console (automatically activates the venv)
However, I also lacked the following
intellisense for javascript (I believe they require a paid
license)
I recently tried visual studio but it lacked
GUI package installer
Is there an ide that can give me all the aforementioned features? I need to use this ide for full stack development in Python