Skip to content

Commit

Permalink
Remove cellprofiler dependency from core (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Stirling authored Jun 22, 2021
1 parent 2dbaf25 commit 00248b1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cellprofiler_core/utilities/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
import threading

import cellprofiler
from importlib.util import find_spec


def find_python():
Expand All @@ -19,9 +19,13 @@ def find_worker_env(idx):
idx - index of the worker, e.g., 0 for the first, 1 for the second...
"""
newenv = os.environ.copy()
root_dir = os.path.abspath(
os.path.join(os.path.dirname(cellprofiler.__file__), "..")
)
cp_install = find_spec("cellprofiler")
if cp_install:
root_dir = os.path.abspath(
os.path.join(os.path.dirname(cp_install.origin), "..")
)
else:
root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
added_paths = []
if "PYTHONPATH" in newenv:
old_path = newenv["PYTHONPATH"]
Expand Down

0 comments on commit 00248b1

Please sign in to comment.