Reputation: 1275
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
https://devblogs.microsoft.com/devops/make-debugging-faster-with-visual-studio/
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")
Upvotes: 5
Views: 1780
Reputation: 2409
To disable "Enable native code debugging" in the solution properties helped for me.
Upvotes: 0
Reputation: 423
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.
Upvotes: 0
Reputation: 1275
Fixed!! I deleted my Visual Studio solution and project file. Create the python project brand new, all fixed!
Upvotes: 2