OpenVoiceOS / ovos-plugin-manager

plugin manager for OpenVoiceOS , STT/TTS/Wakewords that can be used anywhere
Apache License 2.0
12 stars 11 forks source link

Circular import while importing `StreamHandler` #130

Closed emphasize closed 1 year ago

emphasize commented 1 year ago

(ovos_ocp_files_plugin/plugin.py <--> ovos_plugin_common_play/ocp/utils.py) stumbled accross this while checking the supported_seis

>>> from ovos_plugin_manager.ocp import StreamHandler
2023-03-16 22:07:56.215 - OVOS - ovos_utils.process_utils:PIDLock:301 - INFO - Create PIDLock in: None
2023-03-16 22:07:56.793 - OVOS - ovos_config.models:load_local:96 - DEBUG - Configuration /home/sgee/ovos-core/venv/lib/python3.10/site-packages/mycroft/configuration/mycroft.conf loaded
2023-03-16 22:07:56.805 - OVOS - ovos_config.models:load_local:96 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded
2023-03-16 22:07:56.816 - OVOS - ovos_config.models:load_local:102 - DEBUG - Configuration '/home/sgee/.config/mycroft/web_cache.json' not defined, skipping
2023-03-16 22:07:56.981 - OVOS - ovos_config.models:load_local:96 - DEBUG - Configuration /home/sgee/.config/mycroft/mycroft.conf loaded
2023-03-16 22:07:56.992 - OVOS - ovos_config.models:load_local:102 - DEBUG - Configuration '/etc/xdg/mycroft/mycroft.conf' not defined, skipping
2023-03-16 22:07:57.003 - OVOS - ovos_config.models:load_local:102 - DEBUG - Configuration '/home/sgee/.mycroft/mycroft.conf' not defined, skipping
>>> x = StreamHandler()
2023-03-16 22:08:12.254 - OVOS - ovos_utils.intents.layers:<module>:5 - ERROR - This module is deprecated, import from `ovos_workshop.skills.layers
2023-03-16 22:08:12.340 - OVOS - ovos_utils.configuration:<module>:52 - WARNING - configuration moved to the `ovos_config` package. This submodule will be removed in ovos_utils 0.1.0
2023-03-16 22:08:13.632 - OVOS - ovos_plugin_manager.utils:find_plugins:89 - ERROR - Failed to load plugin entry point ovos-ocp-files-plugin = ovos_ocp_files_plugin.plugin:OCPFilesMetadataExtractor
Traceback (most recent call last):
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_plugin_manager/utils/__init__.py", line 87, in find_plugins
    entrypoints[entry_point.name] = entry_point.load()
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2465, in load
    return self.resolve()
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/pkg_resources/__init__.py", line 2471, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_ocp_files_plugin/plugin.py", line 9, in <module>
    from ovos_plugin_common_play.ocp.status import TrackState, PlaybackType
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_plugin_common_play/__init__.py", line 5, in <module>    from ovos_plugin_common_play.ocp import OCP
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_plugin_common_play/ocp/__init__.py", line 5, in <module>
    from ovos_plugin_common_play.ocp.gui import OCPMediaPlayerGUI
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_plugin_common_play/ocp/gui.py", line 13, in <module>    from ovos_plugin_common_play.ocp.utils import is_qtav_available
  File "/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_plugin_common_play/ocp/utils.py", line 10, in <module>
    from ovos_ocp_files_plugin.plugin import OCPFilesMetadataExtractor
ImportError: cannot import name 'OCPFilesMetadataExtractor' from partially initialized module 'ovos_ocp_files_plugin.plugin' (most likely due to a circular import) (/home/sgee/ovos-core/venv/lib/python3.10/site-packages/ovos_ocp_files_plugin/plugin.py)
NeonDaniel commented 1 year ago

I think this might come from OCP and not OPM

NeonDaniel commented 1 year ago

Is this symptom still present or can this issue be closed?

emphasize commented 1 year ago

just forgot about it. No, not experienced it since.