Re: cellprofiler
On Mon, Dec 12, 2011 at 12:16, Mathieu Malaterre
<mathieu.malaterre@gmail.com> wrote:
> On Mon, Dec 12, 2011 at 11:35 AM, Thouis Jones <thouis.jones@curie.fr> wrote:
>> You're looking at the right file, I just missed that change. I just
>> pushed a new version with the import moved into main(). Is that
>> sufficient to fix the bug?
>
> Nope...
>
> WARNING:root:Distributed support disabled: please install nuageux
> Traceback (most recent call last):
> File "/usr/share/pyshared/CellProfiler.py", line 495, in <module>
> main()
> File "/usr/share/pyshared/CellProfiler.py", line 169, in main
> import numpy as np
I don't think this should be fixed in CellProfiler's code. My reading
of Zbigniew's message was that an indirection layer should be used,
with something like this in /usr/bin/CellProfiler:
#!/usr/bin/python
import sys
import CellProfiler
# fix sys.path to allow numpy import
if '/usr/share/pyshared' in sys.path:
sys.path.remove('/usr/share/pyshared')
CellProfiler.main()
I added the part about fixing sys.path, because it seems like it's
necessary to be able to import numpy at all. I might be missing
something, however, and once an indirection layer is in place, perhaps
there's no need for that correction.
Thouis
Reply to: