Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I've had this problem with "ghost Python processes" before as well when trying to delete old copies of Sage. There is something weird with how Terminal finishes certain processes. Here's how I've dealt with it.

  1. Make sure you have all Sage and other Python-related processes closed. Might as well close everything you can.
  2. Open your Terminal.app program. This is located in Applications -> Utilities (if you go into Finder, you can also do Command+U).
  3. Make the Terminal window as tall as you can make it by dragging.
  4. Run the command top -o -command -O time. This will list all processes (a lot) in reverse alphabetical order by command name (the first thing) and then in order by how long they ran, if there is more than one with the same name.
  5. You'll be looking for the ones labeled python. If there are some that don't seem to be doing much and have fairly high PID values, they are probably from old Sage runs. I don't know why they don't die. Here's a sample from mine now.
  6. Quit top by pressing q.
  7. Kill the process with the command kill 47776, where you replace the number with your number.
  8. If that doesn't kill it (check with top again), then use kill -9 47776.

I can't guarantee that this will be your process, but on a Mac the process ID should be something five digits, so this is quite likely it.

It won't format right if I don't put it here - here is a piece of what top output looks like. Notice the ID number on the left.

 05-   scClient     0.0  03:54.38 3    1    65    79    332K   4340K  1268K  31M 
 86067  quicklookd   0.0  00:00.43 9    2    101   127   12M    14M    24M    557M 
 47776  python       0.0  01:59.77 1    0    19    79    1016K  244K   1632K  11M  
 169-   prl_naptd    0.0  01:32.74 3    1    45    76    364K   8232K  2228K  30M 
 193-   prl_disp_ser 0.1  15:21.21 12   1    5814  123   1996K  8296K  6232K  36M