0

I am working with python standard library/some 3rd party module which is not working as expected. I used below steps to install the module.

sudo git clone http://github.com/someopensourcemodule.git
sudo python setup.py install

There is a failure which is seen in the above library which I am using, this library is used part of some other script(a complex script with lot of dynamic binding).

What I want to do is add a few print statements in foo module and also have an ability to step through the code. What options do I have?

  1. Create a virtual environment.
  2. Modify the source add prints and install using python setup.py install again
  3. check the stdout for variable and stack value.
  4. options which I can use pdb, pudb, or Debugging tools in python, this works well for modules. However I am not sure about modules which are installed using python setup.py install.

I want to know what are best practices which can be followed to debug module which is installed in system.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 1
    Use `python setup.py develop` if you're planning to make changes to the source code, then you don't need to keep reinstalling. – jonrsharpe Apr 09 '17 at 07:54
  • @jonrshape can you please provide more info on how does it work, where the build module gets stored(path). It would be really very helpful – PartTimeEngineer Apr 09 '17 at 07:59
  • 1
    It doesn't get "stored" anywhere, you can just edit the source code in your local clone of the repo. – jonrsharpe Apr 09 '17 at 08:00

0 Answers0