How to debug pip install
Matthew Barrera
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!
11 Answer
This question appears to have been answered on Stack Overflow though the answer hasn't been accepted over there.