Skip to content

[Bug]: SkillLoader relative paths break when package is installed via pip #13

@rosspeili

Description

@rosspeili

Affected Component

Core Framework (Loader/Env)

Skill Name (if applicable)

n/a

Bug Description

When skillware is installed into a virtual environment's site-packages via pip, the relative path calculation in loader.py fails to locate a user's local skills/ directory if they are working in a completely separate project. It instead looks for the skills folder inside the site-packages/skillware/... path.

We need it to respect os.getcwd() or read from an environment variable (e.g., SKILLWARE_SKILL_PATH) before falling back.

Steps to Reproduce

  1. pip install skillware
  2. Create a local skills/ folder containing a valid skill in a completely new directory.
  3. Write a script in that directory attempting to load the skill using a relative path: SkillLoader.load_skill("my_local_skill").
  4. Observe a FileNotFoundError as the loader attempts to look inside the site-packages/skillware directory instead of your local project.

Error Logs

FileNotFoundError: Skill not found at /path/to/venv/lib/site-packages/skillware/core/../../skills/my_local_skill

Environment

  • OS: Any OS
  • Python Version: 3.11+
  • Skillware Version: Current main branch

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcore frameworkChanges to loader, env, or base classes.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions