Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Dependency issue with running hyperion entry point #1346

Closed
DominicOram opened this issue Apr 30, 2024 · 3 comments
Closed

Dependency issue with running hyperion entry point #1346

DominicOram opened this issue Apr 30, 2024 · 3 comments
Assignees

Comments

@DominicOram
Copy link
Collaborator

If I run the hyperion entry point e.g.

source .venv/bin/activate
hyperion

I get the error of:

Traceback (most recent call last):
  File "/scratch/ffv81422/hyperion/hyperion/.venv/bin/hyperion", line 33, in <module>
    sys.exit(load_entry_point('hyperion', 'console_scripts', 'hyperion')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/ffv81422/hyperion/hyperion/.venv/bin/hyperion", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/importlib/metadata/__init__.py", line 202, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/dls_sw/apps/python/miniforge/4.10.0-0/envs/python3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/scratch/ffv81422/hyperion/hyperion/src/hyperion/__main__.py", line 9, in <module>
    from blueapi.core import BlueskyContext, MsgGenerator
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/blueapi/core/__init__.py", line 2, in <module>
    from .bluesky_types import (
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/blueapi/core/bluesky_types.py", line 21, in <module>
    from dls_bluesky_core.core import MsgGenerator, PlanGenerator
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/dls_bluesky_core/core/__init__.py", line 4, in <module>
    from .types import MsgGenerator, PlanGenerator, ScannableAxis
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/dls_bluesky_core/core/types.py", line 4, in <module>
    from ophyd_async.core import Device
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/ophyd_async/core/__init__.py", line 17, in <module>
    from .device_save_loader import (
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/ophyd_async/core/device_save_loader.py", line 11, in <module>
    from epicscorelibs.ca.dbr import ca_array, ca_float, ca_int, ca_str
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/epicscorelibs/ca/dbr.py", line 10, in <module>
    from . import cadef
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/epicscorelibs/ca/cadef.py", line 21, in <module>
    from epicscorelibs import path
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/epicscorelibs/path/__init__.py", line 6, in <module>
    from setuptools_dso.runtime import dylink_prepare_dso, find_dso
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/setuptools_dso/__init__.py", line 8, in <module>
    from setuptools import setup as _setup
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/setuptools/__init__.py", line 16, in <module>
    import setuptools.version
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3259, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/ffv81422/hyperion/hyperion/.venv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'stomp.py' distribution was not found and is required by blueapi

This is the way that run_hyperion.sh calls hyperion so we want it to work.

Acceptance Criteria

  • I am able to run run_hyperion.sh with no errors
@DominicOram
Copy link
Collaborator Author

Spent some time looking at this.

  • If you modify setup.cfg to instead use blueapi @ git+https://github.com/DiamondLightSource/blueapi.git@main then do pip install -e . a similar error instead moves to workflows.
  • I think this issue comes from somewhere in the magic import logic that the entrypoint uses not being happy that stomp-py and stomp.py are the same module
  • Options are:
    1. Fix the import magic
    2. Fix our dependencies to use stomp-py rather than stomp.py
    3. Switch to using python -m hyperion

@DominicOram
Copy link
Collaborator Author

workflows is our only other dependency that does this and is a DLS module so I think we do ii and temporarily do iii whilst we're waiting for a release of workflows

@DominicOram DominicOram changed the title Stomp issue with running hyperion entry point Dependency issue with running hyperion entry point May 7, 2024
@DominicOram
Copy link
Collaborator Author

DominicOram commented May 7, 2024

workflows is now released and works but there is an issue with starlette. This will be fixed when DiamondLightSource/blueapi#456 is merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant