broadinstitute / pe2loaddata

Script to parse a Phenix metadata XML file and generate a .CSV for CellProfiler's loaddata module
BSD 2-Clause "Simplified" License
1 stars 6 forks source link

ModuleNotFoundError #25

Closed dlogan closed 2 years ago

dlogan commented 2 years ago

When I run on our local Linux system (not AWS), recent changes seem to have caused a problem:

logand05@amrndhl1317 ~/github/pe2loaddata $ pe2loaddata --help
Traceback (most recent call last):
  File "/home/logand05/.local/bin/pe2loaddata", line 11, in <module>
    load_entry_point('pe2loaddata', 'console_scripts', 'pe2loaddata')()
  File "/nfs/grid/software/RHEL7/ib/software/python/3.8.0/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/nfs/grid/software/RHEL7/ib/software/python/3.8.0/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/nfs/grid/software/RHEL7/ib/software/python/3.8.0/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/nfs/grid/software/RHEL7/ib/software/python/3.8.0/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'src'

When I revert to June 11, and reinstall, it seems to work fine:

logand05@amrndhl1317 ~/github/pe2loaddata $ git checkout 418517928a1af44a828895e1d1e00334c21a6ee5 .
logand05@amrndhl1317 ~/github/pe2loaddata $ python3 -m pip install -e . --user
Obtaining file:///home/logand05/github/pe2loaddata
Requirement already satisfied: click>=7.1.2 in /home/logand05/.local/lib/python3.8/site-packages (from pe2loaddata==0.1.0) (8.0.1)
Requirement already satisfied: PyYAML>=5.3.1 in /home/logand05/.local/lib/python3.8/site-packages (from pe2loaddata==0.1.0) (5.4.1)
Installing collected packages: pe2loaddata
  Attempting uninstall: pe2loaddata
    Found existing installation: pe2loaddata 0.1.1
    Uninstalling pe2loaddata-0.1.1:
      Successfully uninstalled pe2loaddata-0.1.1
  Running setup.py develop for pe2loaddata
Successfully installed pe2loaddata-0.1.0
logand05@amrndhl1317 ~/github/pe2loaddata $ pe2loaddata --help
Usage: pe2loaddata [OPTIONS] CONFIGURATION OUTPUT

Options:
  --index-directory PATH   directory containing the index file and images
  --index-file FILE        the Phenix index XML metadata file
  --search-subdirectories  Look for image files in the index-directory and
                           subdirectories
  --illum-only             Run only the step to append illum columns to an
                           existing file. The "output" CSV will be used
                           instead as input, and you will need to pass
                           --illum-directory and --plate-id, and
                           --illum_output.
  --illum / --no-illum     Run both the main pe2loaddata function and the
                           append_illum function. Default is false; if true
                           you need to pass --illum-directory, --plate_id, and
                           --illum_output.
  --illum-directory PATH   directory where illumination correction images are
                           or will be
  --plate-id TEXT          Plate ID
  --illum-filetype TEXT    The file type of the illum files- in CP2.X, this
                           should be '.mat', in CP3.X or 4.X '.npy'
  --illum-output FILE      The destination file for the illum output if both
                           pe2loaddata and append illum are being run
  --sub-string-out TEXT    A part of the row (typically a path) you want
                           substituted by sub-string-in
  --sub-string-in TEXT     A part of the row (typically a path) you want
                           substituted instead of sub-string-out
  --help                   Show this message and exit.
bethac07 commented 2 years ago

Oops, I see what happened. I fixed it for importing but broke it for command line. There should be no difference running 0.1.0 vs 0.1.1 if you're running via the CLI, but I'll try to make sure the fix didn't break anything else and get 0.1.2 pushed and built.

https://github.com/broadinstitute/pe2loaddata/pull/26