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
9.01k stars 706 forks source link

Get this error when I use sgpt: `ValueError: not enough values to unpack (expected 2, got 1)` #269

Closed trbedwards closed 1 year ago

trbedwards commented 1 year ago

When I invoke sgpt, I get this error:

sgpt "mass of mars"
Traceback (most recent call last):
  File "/home/tedwards/mambaforge/bin/sgpt", line 5, in <module>
    from sgpt import cli
  File "/home/tedwards/mambaforge/lib/python3.10/site-packages/sgpt/__init__.py", line 1, in <module>
    from .app import main as main
  File "/home/tedwards/mambaforge/lib/python3.10/site-packages/sgpt/app.py", line 16, in <module>
    from sgpt.config import cfg
  File "/home/tedwards/mambaforge/lib/python3.10/site-packages/sgpt/config.py", line 84, in <module>
    cfg = Config(SHELL_GPT_CONFIG_PATH, **DEFAULT_CONFIG)
  File "/home/tedwards/mambaforge/lib/python3.10/site-packages/sgpt/config.py", line 41, in __init__
    self._read()
  File "/home/tedwards/mambaforge/lib/python3.10/site-packages/sgpt/config.py", line 73, in _read
    key, value = line.strip().split("=")
ValueError: not enough values to unpack (expected 2, got 1)
trbedwards commented 1 year ago

Ah nevermind, I misinterpreted the instructions and directly copied my OpenAI key into ~/config/shell_gpt/.sgptrc. I removed that file, copied my key into the prompt

chunchiehdev commented 4 months ago

~/.config/shell_gpt/.sgptrc

OPENAI_API_KEY=your_api_key