No module named 'platereader' error

Hello, I have gotten PyHamilton up and running, but am getting a module error when trying to run a specific method.

I’m specifically trying to do some testing with PRANCE (GitHub - dgretton/std-96-pace: Standard method for running 96 PACE experiments on one plate), and am getting the following error when trying to run the main robot method (–simulate):

USING SITE-PACKAGES pyhamilton
Traceback (most recent call last):
  File "C:\Users\BiologyHamilton1\Desktop\PRANCE\std-96-pace-master\pace_util.py", line 22, in <module>
    imported_mod = importlib.import_module(pkgname)
  File "C:\Users\BiologyHamilton1\AppData\Local\Programs\Python\Python39-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'platereader'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\BiologyHamilton1\Desktop\PRANCE\std-96-pace-master\robot_method.py", line 11, in <module>
    from pace_util import (
  File "C:\Users\BiologyHamilton1\Desktop\PRANCE\std-96-pace-master\pace_util.py", line 26, in <module>
    imported_mod = importlib.import_module(pkgname)
  File "C:\Users\BiologyHamilton1\AppData\Local\Programs\Python\Python39-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'platereader'

Here is the code this is referencing:

import pyhamilton
from pyhamilton import (HamiltonInterface, LayoutManager, ResourceType, Plate24, Plate96, Tip96,
    INITIALIZE, PICKUP, EJECT, ASPIRATE, DISPENSE, ISWAP_GET, ISWAP_PLACE, HEPA,
    WASH96_EMPTY, PICKUP96, EJECT96, ASPIRATE96, DISPENSE96,
    oemerr, PositionError)
from platereader.clariostar import ClarioStar, PlateData
from auxpump.pace import OffDeckCulturePumps, LBPumps
from auxshaker.bigbear import Shaker
import send_email

Additionally, if I manually try the imports that are after ‘platereader’ individually in the python shell, they too give the same “no module named ‘xx’” error. What I’ve found suggests this is a path issue somehow, but I’m not sure where these modules should be located. I should add I’m not sure if this is a pyhamilton problem or a PRANCE problem, specifically…

Any ideas?

You are missing the platereader library he uses. Download here and install with pip

Thanks BirdBare, I wasn’t aware of that library. Unfortunately installing it doesn’t seem to have done anything for me, as I am getting the same error. That is assuming I installed it correctly and don’t need to do any path updates or anything to make it visible.

Here is a bit more of the code referenced in the error (from the pace_util.py file in the PRANCE repo):

this_file_dir = os.path.dirname(__file__)
methods_dir = os.path.abspath(os.path.join(this_file_dir, '..', '..', '..'))
dropbox_dir = os.path.dirname(methods_dir)
user_dir = os.path.dirname(dropbox_dir)
global_log_dir = os.path.join(dropbox_dir, 'Monitoring', 'log')

pyham_pkg_path = os.path.join(methods_dir, 'perma_oem', 'pyhamilton')
reader_mod_path = os.path.join(methods_dir, 'perma_plate_reader', 'platereader')
pump_pkg_path = os.path.join(methods_dir, 'perma_pump', 'auxpump')
shaker_pkg_path = os.path.join(methods_dir, 'perma_shaker', 'auxshaker')

LAYFILE = os.path.join(this_file_dir, 'assets', 'deck.lay')

for imp_path in (pyham_pkg_path, reader_mod_path, pump_pkg_path, shaker_pkg_path):
    pkgname = os.path.basename(imp_path)
    try:
        imported_mod = importlib.import_module(pkgname)
    except ModuleNotFoundError:
        if imp_path not in sys.path:
            sys.path.append(imp_path)
            imported_mod = importlib.import_module(pkgname)
    print('USING ' + ('SITE-PACKAGES ' if 'site-packages' in os.path.abspath(imported_mod.__file__) else 'LOCAL ') + pkgname)

import pyhamilton
from pyhamilton import (HamiltonInterface, LayoutManager, ResourceType, Plate24, Plate96, Tip96,
    INITIALIZE, PICKUP, EJECT, ASPIRATE, DISPENSE, ISWAP_GET, ISWAP_PLACE, HEPA,
    WASH96_EMPTY, PICKUP96, EJECT96, ASPIRATE96, DISPENSE96,
    oemerr, PositionError)
from platereader.clariostar import ClarioStar, PlateData
from auxpump.pace import OffDeckCulturePumps, LBPumps
from auxshaker.bigbear import Shaker
import send_email

How did you install? “pip install .”?

Sorry. To be more helpful:

  • Download the package zip file from the link above
  • Open a terminal and change to the directory
  • Once in the same directory as the setup.py file run the command “pip install .” to install the package on your system.

Should then work.

Yes, used “pip install .” for platereader, exactly as you described.

My apologies then. I’ve reached the end of my usefulness. I also installed the package and do not have issues on my system. Are you sure it is the same ModuleNotFoundError after installation?

Thanks for helping regardless. Yes, it is exactly the same error as pre-platereader install.

1 Like

Hi, sorry for the confusion. That PRANCE script isn’t maintained anymore and it could be a lot of effort to get it working as intended. If you want to just test the liquid-handling part, you can remove any code that references the plate reader. Unless you have the same model of plate reader as we used, it won’t be any use for you anyway.

Are you mainly interested in using scripts more complicated than the basic one that ships with the package? Or are you actually trying to run PRANCE?

Hey Stefan, thanks for jumping in. This is kind of the conclusion that I had started to come to, so thanks for clarifying.

I am looking to build a sort of PRANCE-like system, so was hoping to just get what had already been done at least simulated to help jumpstart that. I’m going to explore some other options for the time being.