Revision 10997, mas osx matplotlib

Hi,
I had a matplotlib problem (not found). I installed matplotlib, I thought, and this is what I get now. I am running in batch mode, to test a job that will be run on a cluster.
Thanks
Ela

$ python …/…/CellProfiler2.0.app/Contents/Resources/CellProfiler.py -p Batch_data.mat -c -r -b
/Library/Python/2.6/site-packages/matplotlib-0.91.1-py2.6-macosx-10.6-universal.egg/matplotlib/init.py:62: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5, os, re, shutil, sys, warnings
/Library/Python/2.6/site-packages/matplotlib-0.91.1-py2.6-macosx-10.6-universal.egg/pytz/tzinfo.py:5: DeprecationWarning: the sets module is deprecated
from sets import Set
Traceback (most recent call last):
File “…/…/CellProfiler2.0.app/Contents/Resources/CellProfiler.py”, line 338, in
import imagej.ijbridge as ijbridge
ImportError: No module named imagej.ijbridge
Caught exception while killing ijbridge.
Traceback (most recent call last):
File “…/…/CellProfiler2.0.app/Contents/Resources/CellProfiler.py”, line 347, in
import cellprofiler.utilities.jutil as jutil
ImportError: No module named cellprofiler.utilities.jutil
Caught exception while killing VM
Traceback (most recent call last):
File “…/…/CellProfiler2.0.app/Contents/Resources/CellProfiler.py”, line 230, in
import cellprofiler.preferences as cpprefs
ImportError: No module named cellprofiler.preferences

Hi Ela,
I think you can’t use the Mac system Python to open the release version; you probably need to execute the Python that’s packaged with the application: Contents/MacOS/python. I am guessing you have to set PYTHONPATH and LD_LIBRARY_PATH (and possibly more environment variables) to do that. I have a feeling that what you want to do is something like the following:

open ../../CellProfiler2.0.app --args -p Batch_data.mat -c -r -b

This will execute CellProfiler as if launched from the finder. Let me know if that works. If you need to modify the CellProfiler sources, we can walk you through that.

–Lee

Hi Lee,

my system setup for python is a bit complex. I installed Galaxy, and then some other libraries for python - automatically, and this is a total mess now with the paths. I need one setup for CP and another one for Galaxy and the pipelines that go with it.

I would like to create a profile file which will set up all the variables for CellProfiler and then another one for Galaxy.
What do I need to have in that file for the setup to work for CP? I am learning about python setup at the moment, but am not there yet, so an example would help. IF I call my CP directory something, what other stuff is required?

Regards
Ela

[quote=“LeeKamentsky”]Hi Ela,
I think you can’t use the Mac system Python to open the release version; you probably need to execute the Python that’s packaged with the application: Contents/MacOS/python. I am guessing you have to set PYTHONPATH and LD_LIBRARY_PATH (and possibly more environment variables) to do that. I have a feeling that what you want to do is something like the following:

open ../../CellProfiler2.0.app --args -p Batch_data.mat -c -r -b

This will execute CellProfiler as if launched from the finder. Let me know if that works. If you need to modify the CellProfiler sources, we can walk you through that.

–Lee[/quote]

Hi Ela,
You should look at this page here:

cellprofiler.org/wiki/index.php/ … p_on_a_Mac

It’s a little complicated, but the directions address your situation exactly. What we do here is make a “virtual environment” just for CellProfiler development. It does everything for you as far as setting up environment variables and python paths to point at a Python that’s not the system Python. After you’re done, you run “source myvirtualenvironment/bin/activate” from the command line and you’re pointing at this new Python environment.

–Lee