Reasons for pycharm debugging errors:
1. The package name or file name conflicts with the built-in module name;
2. PyQt compatibility issues;
3. Cache problem, you can reload the project and clear the cache;
4. No breakpoints are set during debug;
5. Running configuration issues.
Debugging error report cause analysis:
(i) Conflicts between package or file names and built-in modules
Solution: The package name and file name can not be defined as the system built-in module name, sometimes the runtime display is normal, but the debugging will report an error, for example, the package name or file name is defined as thread
(ii) PyQt compatibility issues
Solution: Switch the default option Auto to the appropriate option
(iii) Caching issues
Solution: Reload the project and clear the cache
Click on Pycharm's File -> Invalidate Caches / Restart..., then select Invalidate and Restart
(iv) Breakpoint issues
Solution: no breakpoints set during debugging
(v) Operational configuration issues
Solution: Click Edit Configurations to configure the file path and python interpreter path.
Content Extension:
PyCharm debugging features
Common Operating Procedures:
Set breakpoints, debug run; then F8 single-step debugging, encountered want to enter the function F7 into, want to come out in the shift + F8, skip do not want to see the place, directly set the next breakpoint, and then F9 past;
Shortcut Keys Detailed:
- step over (F8 shortcut key): In single-step execution, when encountering a sub-function within a function, you will not step into the sub-function, but will execute the sub-function as a whole before stopping, i.e., the sub-function will be executed as a whole step. In the absence of subfunctions, the effect is the same as step into. Simply put, the program code crosses the subfunction, but the subfunction will be executed and not entered.
- step into (F7 shortcut): in single-step execution, encounter sub-functions to enter and continue single-step execution, some will jump to the source code to execute.
- step into my code (Alt+Shift+F7 shortcut): during single-step execution, when encountering a sub-function, it enters and continues single-step execution without going into the source code.
- step out (Shift+F8 shortcut): If you enter a function body, you look at two lines of code, do not want to see, jump out of the current function body, return to the place where the function is called, i.e., use this feature can be.
- Resume program (F9 shortcut): continue to resume the program and run it directly to the next breakpoint.
This is how to solve the problem of pycharm debugging errors in detail, more information about what causes pycharm debugging errors please pay attention to my other related articles!