Skip to content

Fix metaworld_config.json missing from pip installs and AttributeError crash#3017

Merged
imstevenpmwork merged 1 commit intohuggingface:mainfrom
jashshah999:fix/metaworld-packaging-and-none-access-crash
Feb 25, 2026
Merged

Fix metaworld_config.json missing from pip installs and AttributeError crash#3017
imstevenpmwork merged 1 commit intohuggingface:mainfrom
jashshah999:fix/metaworld-packaging-and-none-access-crash

Conversation

@jashshah999
Copy link
Copy Markdown
Contributor

Summary

  • Packaging: metaworld_config.json is not included when lerobot is installed via pip, causing FileNotFoundError at import time for anyone using the metaworld environment. Added the file to both MANIFEST.in (sdist) and pyproject.toml package-data (wheels).

  • Crash fix: sanity_check_dataset_name in control_utils.py accesses policy_cfg.type in the error message when policy_cfg is None, raising an AttributeError instead of the intended ValueError.

Changes

  • MANIFEST.in: Add include src/lerobot/envs/metaworld_config.json
  • pyproject.toml: Add [tool.setuptools.package-data] section with lerobot = ["envs/*.json"]
  • src/lerobot/utils/control_utils.py: Remove policy_cfg.type reference from error message where policy_cfg is guaranteed to be None

Test plan

  • Verified metaworld_config.json loads correctly from source tree
  • Verified all 4 branches of sanity_check_dataset_name behave correctly (raises ValueError as intended, no longer crashes with AttributeError)

Fixes #2958

…ror crash

1. Include metaworld_config.json in package distributions by adding it to
   both MANIFEST.in (for sdist) and pyproject.toml package-data (for wheels).
   Without this, pip-installed lerobot raises FileNotFoundError when
   importing the metaworld environment.

2. Fix crash in sanity_check_dataset_name where the error message accesses
   policy_cfg.type when policy_cfg is None, raising AttributeError instead
   of the intended ValueError.

Fixes huggingface#2958
Copy link
Copy Markdown
Collaborator

@imstevenpmwork imstevenpmwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@imstevenpmwork imstevenpmwork merged commit f138e59 into huggingface:main Feb 25, 2026
8 checks passed
pkooij pushed a commit that referenced this pull request Feb 27, 2026
…ror crash (#3017)

1. Include metaworld_config.json in package distributions by adding it to
   both MANIFEST.in (for sdist) and pyproject.toml package-data (for wheels).
   Without this, pip-installed lerobot raises FileNotFoundError when
   importing the metaworld environment.

2. Fix crash in sanity_check_dataset_name where the error message accesses
   policy_cfg.type when policy_cfg is None, raising AttributeError instead
   of the intended ValueError.

Fixes #2958
xianglunkai pushed a commit to xianglunkai/lerobot that referenced this pull request Feb 28, 2026
…ror crash (huggingface#3017)

1. Include metaworld_config.json in package distributions by adding it to
   both MANIFEST.in (for sdist) and pyproject.toml package-data (for wheels).
   Without this, pip-installed lerobot raises FileNotFoundError when
   importing the metaworld environment.

2. Fix crash in sanity_check_dataset_name where the error message accesses
   policy_cfg.type when policy_cfg is None, raising AttributeError instead
   of the intended ValueError.

Fixes huggingface#2958
sorelferris pushed a commit to sorelferris/lerobot that referenced this pull request Mar 1, 2026
…ror crash (huggingface#3017)

1. Include metaworld_config.json in package distributions by adding it to
   both MANIFEST.in (for sdist) and pyproject.toml package-data (for wheels).
   Without this, pip-installed lerobot raises FileNotFoundError when
   importing the metaworld environment.

2. Fix crash in sanity_check_dataset_name where the error message accesses
   policy_cfg.type when policy_cfg is None, raising AttributeError instead
   of the intended ValueError.

Fixes huggingface#2958
lu391see pushed a commit to lu391see/lerobot_tactile that referenced this pull request Mar 24, 2026
…ror crash (huggingface#3017)

1. Include metaworld_config.json in package distributions by adding it to
   both MANIFEST.in (for sdist) and pyproject.toml package-data (for wheels).
   Without this, pip-installed lerobot raises FileNotFoundError when
   importing the metaworld environment.

2. Fix crash in sanity_check_dataset_name where the error message accesses
   policy_cfg.type when policy_cfg is None, raising AttributeError instead
   of the intended ValueError.

Fixes huggingface#2958
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

Successfully merging this pull request may close these issues.

Metaworld config missing

2 participants