Skip to content
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

[BUG] Swarms Environment Variables and Template Swarms #632

Open
evelynmitchell opened this issue Nov 14, 2024 · 0 comments
Open

[BUG] Swarms Environment Variables and Template Swarms #632

evelynmitchell opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@evelynmitchell
Copy link
Contributor

evelynmitchell commented Nov 14, 2024

Describe the bug
Was running Legal-Swarm-Template/main.py in a colab notebook with python 3.10:

Traceback (most recent call last):
  File "/content/Legal-Swarm-Template/main.py", line 7, in <module>
    from swarms.agents.create_agents_from_yaml import (
  File "/usr/local/lib/python3.10/dist-packages/swarms/__init__.py", line 6, in <module>
    from swarms.telemetry.bootup import bootup  # noqa: E402, F403
  File "/usr/local/lib/python3.10/dist-packages/swarms/telemetry/bootup.py", line 7, in <module>
    from swarms.utils.disable_logging import disable_logging
  File "/usr/local/lib/python3.10/dist-packages/swarms/utils/__init__.py", line 2, in <module>
    from swarms.utils.data_to_text import (
  File "/usr/local/lib/python3.10/dist-packages/swarms/utils/data_to_text.py", line 5, in <module>
    from swarms.utils.pdf_to_text import pdf_to_text
  File "/usr/local/lib/python3.10/dist-packages/swarms/utils/pdf_to_text.py", line 2, in <module>
    from swarms.utils.try_except_wrapper import try_except_wrapper
  File "/usr/local/lib/python3.10/dist-packages/swarms/utils/try_except_wrapper.py", line 5, in <module>
    from swarms.utils.loguru_logger import logger
  File "/usr/local/lib/python3.10/dist-packages/swarms/utils/loguru_logger.py", line 8, in <module>
    os.path.join(WORKSPACE_DIR, "swarms.log"),
  File "/usr/lib/python3.10/posixpath.py", line 76, in join
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

The error is occurring because WORKSPACE_DIR, which is used for logging is not set.

The .env.example fot Legal-Swarms-Template only includes the OpenAI and Groq api keys.

When someone uses the template, and not the swarms source install, they would not see the full list of environment variables assumed to be available in swarms, as shown in swarms/.env.example

Perhaps a more robust swarms install process, or configuration tool could be used to set the env vars in projects that use swarms.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants