gpt-engineer icon indicating copy to clipboard operation
gpt-engineer copied to clipboard

Installation fails using both pip and git clone

Open ztxtz opened this issue 2 years ago • 4 comments

Running it after pip install results in this: https://github.com/AntonOsika/gpt-engineer/issues/180 Running it from git clone results in this:

gpt-engineer --model gpt-3.5-turbo app

Traceback (most recent call last):

  File "/Users/x/code/gpt-eng-test/gpt-engineer/venv/bin/gpt-engineer", line 8, in <module>
    sys.exit(app())
             ^^^^^

  File "/Users/x/code/gpt-eng-test/gpt-engineer/gpt_engineer/main.py", line 58, in main
    messages = step(ai, dbs)
               ^^^^^^^^^^^^^

  File "/Users/x/code/gpt-eng-test/gpt-engineer/gpt_engineer/steps.py", line 18, in simple_gen
    dbs.input["main_prompt"],
    ~~~~~~~~~^^^^^^^^^^^^^^^

  File "/Users/x/code/gpt-eng-test/gpt-engineer/gpt_engineer/db.py", line 18, in __getitem__
    raise KeyError(key)

KeyError: 'main_prompt'

Python: 3.11.4 pip: 23.1.2

ztxtz avatar Jun 20 '23 11:06 ztxtz

I have the same error used pip3 version 23.0.1 and python 3.11.4

mwseymour avatar Jun 20 '23 11:06 mwseymour

I'm getting:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/main.py:58 in │
│ main                                                                                             │
│                                                                                                  │
│   55 │   )                                                                                       │
│   56 │                                                                                           │
│   57 │   for step in STEPS[steps_config]:                                                        │
│ ❱ 58 │   │   messages = step(ai, dbs)                                                            │
│   59 │   │   dbs.logs[step.__name__] = json.dumps(messages)                                      │
│   60                                                                                             │
│   61                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │              ai = <gpt_engineer.ai.AI object at 0x1162f3940>                                 │ │
│ │             dbs = DBs(                                                                       │ │
│ │                   │   memory=<gpt_engineer.db.DB object at 0x1162f39d0>,                     │ │
│ │                   │   logs=<gpt_engineer.db.DB object at 0x1162f37f0>,                       │ │
│ │                   │   identity=<gpt_engineer.db.DB object at 0x1163259d0>,                   │ │
│ │                   │   input=<gpt_engineer.db.DB object at 0x1162f3790>,                      │ │
│ │                   │   workspace=<gpt_engineer.db.DB object at 0x1163101f0>                   │ │
│ │                   )                                                                          │ │
│ │ delete_existing = False                                                                      │ │
│ │      input_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test')  │ │
│ │     memory_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test/m… │ │
│ │           model = 'gpt-4'                                                                    │ │
│ │    project_path = 'payment-test'                                                             │ │
│ │      run_prefix = ''                                                                         │ │
│ │            step = <function gen_spec at 0x1162f5820>                                         │ │
│ │    steps_config = 'default'                                                                  │ │
│ │     temperature = 0.1                                                                        │ │
│ │         verbose = False                                                                      │ │
│ │  workspace_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test/w… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/steps.py:61   │
│ in gen_spec                                                                                      │
│                                                                                                  │
│    58 │   the workspace                                                                          │
│    59 │   """                                                                                    │
│    60 │   messages = [                                                                           │
│ ❱  61 │   │   ai.fsystem(setup_sys_prompt(dbs)),                                                 │
│    62 │   │   ai.fsystem(f"Instructions: {dbs.input['main_prompt']}"),                           │
│    63 │   ]                                                                                      │
│    64                                                                                            │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │  ai = <gpt_engineer.ai.AI object at 0x1162f3940>               │                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x1162f39d0>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x1162f37f0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x1163259d0>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x1162f3790>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x1163101f0> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/steps.py:11   │
│ in setup_sys_prompt                                                                              │
│                                                                                                  │
│     8                                                                                            │
│     9                                                                                            │
│    10 def setup_sys_prompt(dbs):                                                                 │
│ ❱  11 │   return dbs.identity["generate"] + "\nUseful to know:\n" + dbs.identity["philosophy"    │
│    12                                                                                            │
│    13                                                                                            │
│    14 def simple_gen(ai: AI, dbs: DBs):                                                          │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x1162f39d0>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x1162f37f0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x1163259d0>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x1162f3790>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x1163101f0> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/db.py:21 in   │
│ __getitem__                                                                                      │
│                                                                                                  │
│   18 │   │   │   with full_path.open("r", encoding="utf-8") as f:                                │
│   19 │   │   │   │   return f.read()                                                             │
│   20 │   │   else:                                                                               │
│ ❱ 21 │   │   │   raise KeyError(key)                                                             │
│   22 │                                                                                           │
│   23 │   def __setitem__(self, key, val):                                                        │
│   24 │   │   full_path = self.path / key                                                         │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮   │
│ │ full_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/identity/generate') │   │
│ │       key = 'generate'                                                                     │   │
│ │      self = <gpt_engineer.db.DB object at 0x1163259d0>                                     │   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'generate'
➜  gpt-engineer-prompting gpt-engineer payment-test
INFO:openai:error_code=model_not_found error_message="The model 'gpt-4' does not exist" error_param=model error_type=invalid_request_error message='OpenAI API error received' stream_error=False
Model gpt-4 not available for provided API key. Reverting to gpt-3.5-turbo. Sign up for the GPT-4 wait list here: https://openai.com/waitlist/gpt-4-api
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/main.py:58 in │
│ main                                                                                             │
│                                                                                                  │
│   55 │   )                                                                                       │
│   56 │                                                                                           │
│   57 │   for step in STEPS[steps_config]:                                                        │
│ ❱ 58 │   │   messages = step(ai, dbs)                                                            │
│   59 │   │   dbs.logs[step.__name__] = json.dumps(messages)                                      │
│   60                                                                                             │
│   61                                                                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │              ai = <gpt_engineer.ai.AI object at 0x11892a370>                                 │ │
│ │             dbs = DBs(                                                                       │ │
│ │                   │   memory=<gpt_engineer.db.DB object at 0x11892a130>,                     │ │
│ │                   │   logs=<gpt_engineer.db.DB object at 0x11892a1f0>,                       │ │
│ │                   │   identity=<gpt_engineer.db.DB object at 0x118942e20>,                   │ │
│ │                   │   input=<gpt_engineer.db.DB object at 0x11892a3d0>,                      │ │
│ │                   │   workspace=<gpt_engineer.db.DB object at 0x11892a070>                   │ │
│ │                   )                                                                          │ │
│ │ delete_existing = False                                                                      │ │
│ │      input_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test')  │ │
│ │     memory_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test/m… │ │
│ │           model = 'gpt-4'                                                                    │ │
│ │    project_path = 'payment-test'                                                             │ │
│ │      run_prefix = ''                                                                         │ │
│ │            step = <function gen_spec at 0x118915820>                                         │ │
│ │    steps_config = 'default'                                                                  │ │
│ │     temperature = 0.1                                                                        │ │
│ │         verbose = False                                                                      │ │
│ │  workspace_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/payment-test/w… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/steps.py:61   │
│ in gen_spec                                                                                      │
│                                                                                                  │
│    58 │   the workspace                                                                          │
│    59 │   """                                                                                    │
│    60 │   messages = [                                                                           │
│ ❱  61 │   │   ai.fsystem(setup_sys_prompt(dbs)),                                                 │
│    62 │   │   ai.fsystem(f"Instructions: {dbs.input['main_prompt']}"),                           │
│    63 │   ]                                                                                      │
│    64                                                                                            │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │  ai = <gpt_engineer.ai.AI object at 0x11892a370>               │                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x11892a130>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x11892a1f0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x118942e20>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x11892a3d0>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x11892a070> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/steps.py:11   │
│ in setup_sys_prompt                                                                              │
│                                                                                                  │
│     8                                                                                            │
│     9                                                                                            │
│    10 def setup_sys_prompt(dbs):                                                                 │
│ ❱  11 │   return dbs.identity["generate"] + "\nUseful to know:\n" + dbs.identity["philosophy"    │
│    12                                                                                            │
│    13                                                                                            │
│    14 def simple_gen(ai: AI, dbs: DBs):                                                          │
│                                                                                                  │
│ ╭──────────────────────────── locals ────────────────────────────╮                               │
│ │ dbs = DBs(                                                     │                               │
│ │       │   memory=<gpt_engineer.db.DB object at 0x11892a130>,   │                               │
│ │       │   logs=<gpt_engineer.db.DB object at 0x11892a1f0>,     │                               │
│ │       │   identity=<gpt_engineer.db.DB object at 0x118942e20>, │                               │
│ │       │   input=<gpt_engineer.db.DB object at 0x11892a3d0>,    │                               │
│ │       │   workspace=<gpt_engineer.db.DB object at 0x11892a070> │                               │
│ │       )                                                        │                               │
│ ╰────────────────────────────────────────────────────────────────╯                               │
│                                                                                                  │
│ /Users/marcosalazar/.pyenv/versions/3.9.9/lib/python3.9/site-packages/gpt_engineer/db.py:21 in   │
│ __getitem__                                                                                      │
│                                                                                                  │
│   18 │   │   │   with full_path.open("r", encoding="utf-8") as f:                                │
│   19 │   │   │   │   return f.read()                                                             │
│   20 │   │   else:                                                                               │
│ ❱ 21 │   │   │   raise KeyError(key)                                                             │
│   22 │                                                                                           │
│   23 │   def __setitem__(self, key, val):                                                        │
│   24 │   │   full_path = self.path / key                                                         │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮   │
│ │ full_path = PosixPath('/Users/marcosalazar/code/gpt-engineer-prompting/identity/generate') │   │
│ │       key = 'generate'                                                                     │   │
│ │      self = <gpt_engineer.db.DB object at 0x118942e20>                                     │   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'generate'

salazarm avatar Jun 20 '23 17:06 salazarm

@salazarm Try to upload identity directory with it's content to your current directory from which you execute gpt-engineer command.

Sinma1 avatar Jun 20 '23 19:06 Sinma1

That worked for me. Thank you!

clickbrain avatar Jun 20 '23 20:06 clickbrain

I now have this working

mwseymour avatar Jun 21 '23 10:06 mwseymour

If you wish to reopen the issue please do following the new issue template.

patillacode avatar Jun 21 '23 12:06 patillacode