错误:“ dagster.core.types.runtime”不是软件包

时间:2019-12-28 03:38:36

标签: python dagster

首次在conda环境中安装了dagster,并尝试按照here中所述运行航空公司演示。以下是我遵循的步骤。

conda env create -n dagster python=3.7
conda activate dagster
pip install dagster dagit
git clone git@github.com/dagster-io/dagster.git
cd dagster/examples
pip install -e '[.full]'
docker-compose up -d
cd dagster_examples/airline_demo
dagit

然后我得到以下堆栈跟踪,结尾为'dagster.core.types.runtime' is not a package消息:

Loading repository...
Traceback (most recent call last):
  File "/Users/timrozmajzl/miniconda3/envs/dagster/bin/dagit-cli", line 8, in <module>
    sys.exit(main())
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagit/cli.py", line 110, in main
    cli = create_dagit_cli()
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagit/cli.py", line 21, in create_dagit_cli
    return ui(auto_envvar_prefix='DAGIT')  # pylint: disable=no-value-for-parameter
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagit/cli.py", line 72, in ui
    host_dagit_ui(handle, host, port, storage_fallback, reload_trigger)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagit/cli.py", line 81, in host_dagit_ui
    app = create_app(handle, instance, reloader)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagit/app.py", line 160, in create_app
    version=__version__,
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster_graphql/implementation/context.py", line 17, in __init__
    self.repository_definition = self.get_handle().build_repository_definition()
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/definitions/handle.py", line 392, in build_repository_definition
    obj = self.entrypoint.perform_load()
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/definitions/handle.py", line 445, in entrypoint
    return self.data.get_repository_entrypoint(from_handle=self)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/definitions/handle.py", line 522, in get_repository_entrypoint
    return LoaderEntrypoint.from_yaml(self.repository_yaml, from_handle=from_handle)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/definitions/handle.py", line 175, in from_yaml
    return LoaderEntrypoint.from_module_target(module_name, fn_name, from_handle)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/site-packages/dagster/core/definitions/handle.py", line 161, in from_module_target
    module = importlib.import_module(module_name)
  File "/Users/timrozmajzl/miniconda3/envs/dagster/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/timrozmajzl/Projects/dagster/dagster/examples/dagster_examples/airline_demo/repository.py", line 3, in <module>
    from .pipelines import define_airline_demo_ingest_pipeline, define_airline_demo_warehouse_pipeline
  File "/Users/timrozmajzl/Projects/dagster/dagster/examples/dagster_examples/airline_demo/pipelines.py", line 14, in <module>
    from .resources import postgres_db_info_resource, redshift_db_info_resource
  File "/Users/timrozmajzl/Projects/dagster/dagster/examples/dagster_examples/airline_demo/resources.py", line 3, in <module>
    from .types import DbInfo
  File "/Users/timrozmajzl/Projects/dagster/dagster/examples/dagster_examples/airline_demo/types.py", line 8, in <module>
    from dagster.core.types.runtime.runtime_type import create_string_type
ModuleNotFoundError: No module named 'dagster.core.types.runtime.runtime_type'; 'dagster.core.types.runtime' is not a package

1 个答案:

答案 0 :(得分:0)

感谢您报告此问题!经过一番挖掘后,看来commit与当时导致错误的最新dagster版本不兼容。

使用最新的dagster主服务器和依赖项重新运行此工作流程应该可以解决此问题。 Opening an issue here来跟踪更长期的修复。

更多详细信息:在此commit中,'create_string_type'被引入到'examples / dagster_examples / airline_demo / types.py'和'python_modules / dagster / dagster / core / types / runtime / runtime_type.py'中。但是,根据问题中粘贴的命令和airline demo steps中显示的命令,airline_demo管道运行的master提示(包含“ create_string_type”)与较旧的dagster程序包(来自最新版本,不包含该包) 'create_string_type')。