https://dagster.io/ logo
#dagster-cloud
Title
# dagster-cloud
o

Olivier Dupuis

02/10/2023, 8:18 PM
Happy Friday everyone! I’ve finally decided to give Dagster Cloud a try, but I’m running into this error which is just blocking me. Anyone has any idea what that is about (full error in thread): `Encountered ImportError:
cannot import name 'EventMetadataEntry' from 'dagster'
Full error:
Copy code
dagster._core.errors.DagsterImportError: Encountered ImportError: `cannot import name 'EventMetadataEntry' from 'dagster' (/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/__init__.py)` while importing module discursus_internal_analytics. Local modules were resolved using the working directory `/venvs/565c2b5abbc9/lib/python3.8/site-packages/working_directory/root`. If another working directory should be used, please explicitly specify the appropriate path using the `-d` or `--working-directory` for CLI based targets or the `working_directory` configuration option for workspace targets.
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_grpc/server.py", line 266, in __init__
    self._loaded_repositories: Optional[LoadedRepositories] = LoadedRepositories(
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_grpc/server.py", line 115, in __init__
    loadable_targets = get_loadable_targets(
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_grpc/utils.py", line 57, in get_loadable_targets
    else loadable_targets_from_python_package(package_name, working_directory)
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_core/workspace/autodiscovery.py", line 49, in loadable_targets_from_python_package
    module = load_python_module(
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_core/code_pointer.py", line 143, in load_python_module
    raise DagsterImportError(
The above exception was caused by the following exception:
ImportError: cannot import name 'EventMetadataEntry' from 'dagster' (/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/__init__.py)
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster/_core/code_pointer.py", line 138, in load_python_module
    return importlib.import_module(module_name)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/working_directory/root/discursus_internal_analytics/__init__.py", line 8, in <module>
    from dagster_dbt import dbt_cli_resource, load_assets_from_dbt_project
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster_dbt/__init__.py", line 3, in <module>
    from .cli import (
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster_dbt/cli/__init__.py", line 1, in <module>
    from .solids import (
  File "/venvs/565c2b5abbc9/lib/python3.8/site-packages/dagster_dbt/cli/solids.py", line 3, in <module>
    from dagster import (
b

ben

02/10/2023, 8:24 PM
Hi Olivier, this looks like it may be a version mismatch issue, since
EventMetadataEntry
was renamed in
0.14.0
. Are you able to tell which version of
dagster-dbt
&
dagster
you’re using?
o

Olivier Dupuis

02/10/2023, 8:58 PM
Hey @ben, well maybe you can help me out a little with this. I’ve been using poetry to manage dependancies when running Dagster outside of Cloud. But my understanding now is that dependancies need to be defined in the
setup.py
file of it to work with the Serverless option? Anyways, here’s the content of that file:
Copy code
from setuptools import find_packages, setup

if __name__ == "__main__":
    setup(
        name="discursus_internal_analytics",
        packages=find_packages(),
        install_requires=[
            "dagster",
            "dagster-cloud",
            "dagster-dbt"
        ],
    )
I’m not pinning version numbers, so I’m assuming that I’m using the latest versions of dagster and dagster-dbt.
Making progress. Seems like pinning the version numbers solved that issue. Thanks for pointing me in the right direction 🙂
Copy code
from setuptools import find_packages, setup

if __name__ == "__main__":
    setup(
        name="discursus_internal_analytics",
        packages=find_packages(),
        install_requires=[
            "dagster==1.1.18",
            "dagster-cloud==1.1.18",
            "dagster-dbt==0.17.18"
        ],
    )
b

ben

02/10/2023, 9:19 PM
🙌 great! let me know if you run into anything else
👍 1
73 Views