How to debug pip install <package name>

1

If I want to debug the setup.py file of my package packagename getting installed via "pip install packagename" , is there a way to do so? I have tried downloading the source, adding set_trace() in setup.py and run:

pip install .

However, as soon I get pdb() prompt, the install fails with error:

Processing /Users/skauser/python-ibmdb/IBM_DB/ibm_db
    Complete output from command python setup.py egg_info:
    > /private/var/folders/b6/pmddncpn77550p8_g9kkx9f40000gp/T/pip-req-build-_fg8s5a2/setup.py(31)<module>()
    -> machine_bits =  8 * struct.calcsize("P")
    (Pdb)
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/b6/pmddncpn77550p8_g9kkx9f40000gp/T/pip-req-build-_fg8s5a2/setup.py", line 31, in <module>
        machine_bits =  8 * struct.calcsize("P")
      File "/private/var/folders/b6/pmddncpn77550p8_g9kkx9f40000gp/T/pip-req-build-_fg8s5a2/setup.py", line 31, in <module>
        machine_bits =  8 * struct.calcsize("P")
      File "/Library/anaconda3/lib/python3.7/bdb.py", line 88, in trace_dispatch
        return self.dispatch_line(frame)
      File "/Library/anaconda3/lib/python3.7/bdb.py", line 113, in dispatch_line
        if self.quitting: raise BdbQuit
    bdb.BdbQuit

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/b6/pmddncpn77550p8_g9kkx9f40000gp/T/pip-req-build-_fg8s5a2/

Although I can debug the source via: python setup.py build, the behavior that I want to debug is applicable when installed through pip.

Looking forward for recommendations. Thanks!

Saba Kauser

Posted 2019-04-19T08:10:48.087

Reputation: 11

I'm trying to install gdbgui but the install fails. When I try to cd to the /private/var/folders/.... I'm unable to as the folder doesn't exist. I would like to know where pip2 caches its working files so I could go into there and manually adjust what I need to, or figure out the reason for the failure. – gone – 2020-01-26T15:19:38.473

No answers