Python – How to tell if a Python pip install is working correctly or hanging

installationpippython

I am trying to install the python pandas package in a virtualenv using pip.

On my development machine it installed correctly, but now I am trying on the server, it gets so far then it seems to get stuck:

 warnings.warn(LapackSrcNotFoundError.__doc__)
/apps/PYTHON/2.7.3/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
  warnings.warn(msg)
non-existing path in 'numpy/distutils': 'site.cfg'
non-existing path in 'numpy/lib': 'benchmarks'
Could not locate executable gfortran
Could not locate executable f95
Found executable /apps/modules/wrappers/fortran/ifort

Top shows ifort running at 46% cpu.

Is there any way I can tell if this is working correctly (can I check files it is updating for example), or if it is stuck in a loop?

It has been running for 40 minutes so far.

Best Answer

Get the pid (pidof process or top or ps, etc) of the process and use strace -p <pid>. If you see it polling or continuously calling the same syscalls over and over again its probably stuck in an infinite loop. To determine if its stuck in an infinite loop you have to use the time features of strace (although this is just an assumption).

If you just do a plain old strace -p <pid> you'll really only see the syscalls but not the data being passed between them; to see this data also specify the -s parameter. If the process forks itself you wont see any of its children in the strace, so be sure to specify -f to see what syscalls the children are doing.

You may also want to see how long it's taking between syscalls; to do this you can use -tt and -r and -T. If there is polling, it can be completely normal if its waiting on a file to be created.