Skip to content

Import error, no module named dataclasses_json, when importing amplitude-experiments #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
asher-dev opened this issue Feb 6, 2025 · 2 comments
Assignees

Comments

@asher-dev
Copy link

Expected Behavior

Can import modules from the amplitude-experiments library when installed.

Current Behavior

Error when importing due to a missing dependency, dataclasses-json.

    from amplitude_experiment import Variant
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/__init__.py", line 11, in <module>
    from .factory import Experiment
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/factory.py", line 3, in <module>
    from .local.client import LocalEvaluationClient
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/local/client.py", line 13, in <module>
    from ..deployment.deployment_runner import DeploymentRunner
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/deployment/deployment_runner.py", line 8, in <module>
    from ..flag.flag_config_api import FlagConfigApi
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/flag/flag_config_api.py", line 4, in <module>
    from ..evaluation.types import EvaluationFlag
  File "/usr/local/lib/python3.9/site-packages/amplitude_experiment/evaluation/types.py", line 3, in <module>
    from dataclasses_json import dataclass_json
ModuleNotFoundError: No module named 'dataclasses_json'

Possible Solution

Add the dependency to setup.py?

Steps to Reproduce

  1. Install amplitude-experiments package v1.6.2
  2. Run a file containing from amplitude_experiment import Variant (or similar import)

Environment

  • SDK Version: 1.6.2
  • Language Version: 3.9
@bgiori
Copy link
Collaborator

bgiori commented Feb 6, 2025

Thanks @asher-dev, taking a look at this now.

@bgiori bgiori self-assigned this Feb 6, 2025
@bgiori
Copy link
Collaborator

bgiori commented Feb 10, 2025

This should be fixed in 1.6.3

Please let me know if the issue persists and I can reopen.

@bgiori bgiori closed this as completed Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants