Closed ThinkingAgain closed 1 year ago
Are you running the file main.py
directly? The intended usage is to first install the package (pip install -e /path/to/mycli
for dev environments) and then use the installed script ENV_ROOT/bin/mycli
Yes, I running the filemain.py
directly! Because I want to study the code.
I followed the steps of the Development Guide
clone the code.
I'm a beginner and I want to know what is the correct way to debug the code and see the intermediate results of the run?
Depends on your preferred setup for debugging, but you should (almost) always launch the generated mycli
script.
If you use ipdb, then just install mycli with pip install -e /path/to/mycli
(it links the source files instead of copying them, so that the changes are immediately reflected), and insert import ipdb; ipdb.set_trace()
directly in the code.
If you use an IDE debugger, point it to bin/mycli as the executable.
@pasenor Thank you for your patience in answering my question. I use Pycharm
to debug the program, and now after setting the debug script to /scripts/mycli-script.py
, I can do breakpoint debugging. Is this the right way to do it?
yes, sounds right, have fun)
When I build the mycli development environment and run it for the first time, the following error occurs:
When I removed the dot before packages of line 42:
the error disappeared, what is the problem?