TheR1D / shell_gpt

A command-line productivity tool powered by AI large language models like GPT-4, will help you accomplish your tasks faster and more efficiently.
MIT License
8.84k stars 696 forks source link

Potential Bug Report: ModuleNotFoundError for 'pkg_resources' with pipx #479

Closed hcal closed 4 months ago

hcal commented 4 months ago

Description

After upgrading shell-gpt using pipx upgrade-all, running the sgpt command results in a ModuleNotFoundError for the pkg_resources module. This issue has been encountered on both Fedora and Debian Linux desktops.

Environment

Steps to Reproduce

  1. Install shell-gpt using pipx
  2. upgrade pipx pipx upgrade-all.
  3. Run the sgpt command.

Expected Behavior

The sgpt command should run without any errors.

Actual Behavior

The following error is encountered:ModuleNotFoundError: No module named 'pkg_resources'

Workaround

The issue was resolved by injecting setuptools into the shell-gpt environment using the following pipx command: pipx inject shell-gpt setuptools This just adds the setuptools packages to environment.

Notes

I suspect anyone installing fresh would have the same issue. Pipx has worked for me in the past and I've upgraded each time the same way. If pipx isn't an expected use case feel free to close the case.

sorokine commented 4 months ago

this is due to imports in litellm and was fixed here: https://github.com/BerriAI/litellm/pull/1947