nipy / PySurfer

Cortical neuroimaging visualization in Python
https://pysurfer.github.io/
BSD 3-Clause "New" or "Revised" License
240 stars 97 forks source link

FIX SOS: can't import pysurfer, it's searching ffmpeg forever. #148

Closed dengemann closed 8 years ago

dengemann commented 8 years ago

It seems this is quite recent behavior on my machine. No idea how this happend. Any ideas @christianbrodbeck @Eric89GXL ?

dengemann commented 8 years ago

After uninstalling ffmpeg throws at me ValueError: insecure string pickle

larsoner commented 8 years ago

Actually fixing the underlying problem might be hard, but in the meantime we should do something easier. We should nest any import that requires ffmpeg to be present or searched for. It might even decrease our import time. Any idea what line it hangs on? Maybe with pdb you can find it?

dengemann commented 8 years ago

It seems a recent update to zsh might be the issue ... The call to subprocess subprocess.call(["ffmpeg"], stdout=subprocess.PIPE,stderr=subprocess.PIPE)

is going forever, removing the pipe gives regular behaviour.

dengemann commented 8 years ago

It is not the zsh though, when switching to bash I get the same. Really difficult to see what is going on here.

larsoner commented 8 years ago

Removing the pipe allowing it to proceed points to a bug with subprocess and thus Python. But really my guess is that it's Anaconda's fault, since they seem to come up with little bugs like this from time to time (e.g., from using old compilers). Do you have access to any other Python you could try it with? Could you quickly install Canopy or anything else to see if the same issue occurs?

dengemann commented 8 years ago

Hum, a Mac Os serivce update and a reboot after a few months of uptime did the job ... anyways weird. Feel free to close.

larsoner commented 8 years ago

I really need to start keeping track of these OSX oddities somewhere to look at the next time I'm tempted by an Apple product...

dengemann commented 8 years ago

... maybe the "few months of uptime" were the issue.

dengemann commented 8 years ago

This issue is back again ... so weird.

mwaskom commented 8 years ago

Have you tried turning it off and then back on again? :)

dengemann commented 8 years ago

Yeah the reboot trick worked once more. Really funny. Wondering what we can conclude from this.

larsoner commented 8 years ago

It's likely a problem with your OS, not PySurfer/Python. It's probably getting hung up in running a process somehow.

dengemann commented 8 years ago

Probably. Although it's funny that Pysurfer is the victim.

larsoner commented 8 years ago

Since it hangs on a subprocess call, you can see if it hangs when you try to do something equivalent (with piping stdout and stderr somewhere) the terminal next time PySurfer dies this way.

There might be a better way to check though. On Linux you can do which ffmpeg and look at the return code. On OSX there is something similar.

dengemann commented 8 years ago

I suspect it may have to do with dead remainders of Pysurfer activities, e.g., when partially killing processes etc. So the trick is probably to make sure all related processes get killed.