gpt-engineer
gpt-engineer copied to clipboard
IsADirectoryError: [Errno 21] Is a directory
Expected Behavior
Saving the generated project and trying running it.
Current Behavior
GPT Engineer is crashing while trying to execute the code. It doesn't save the generated files on a drive.
After running gpte
on the same prompt and selecting Do you want to execute this code? (Y/n) n
the GPT Engineer saves the code correctly.
Failure Information
I use GPT-4o model.
Failure Logs
The debug_log_file.txt doesn't exist but the following error is generated:
...
│ /home/dawid/.local/lib/python3.10/site-packages/gpt_engineer/core/default/disk_execution_env.py: │
│ 56 in upload │
│ │
│ 53 │ │ self.files = FileStore(path) │
│ 54 │ │
│ 55 │ def upload(self, files: FilesDict) -> "DiskExecutionEnv": │
│ ❱ 56 │ │ self.files.push(files) │
│ 57 │ │ return self │
│ 58 │ │
│ 59 │ def download(self) -> FilesDict: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ files = { │ │
│ │ │ 'app.': 'django-admin startproject api_project\ncd api_project\ndjango-admin │ │
│ │ startapp api_a'+2, │ │
│ │ │ 'api_app/models.py': 'from django.db import models\n\nclass │ │
│ │ Application(models.Model):\n name = models'+882, │ │
│ │ │ 'api_app/serializers.py': 'from rest_framework import serializers\nfrom .models │ │
│ │ import Application, Input, F'+507, │ │
│ │ │ 'api_app/views.py': 'from django.shortcuts import get_object_or_404\nfrom │ │
│ │ rest_framework import status'+3193, │ │
│ │ │ 'api_app/urls.py': "from django.urls import path\nfrom . import │ │
│ │ views\n\nurlpatterns = [\n path('auth"+486, │ │
│ │ │ 'api_project/settings.py': "INSTALLED_APPS = [\n ...\n 'rest_framework',\n │ │
│ │ 'api_app',\n 'django.cont"+530, │ │
│ │ │ 'api_app/admin.py': 'from django.contrib import admin\nfrom .models import │ │
│ │ Application, Scanner\n\nadmin'+56, │ │
│ │ │ 'migrations.': 'python manage.py makemigrations\npython manage.py migrate', │ │
│ │ │ 'panel.': 'python manage.py createsuperuser', │ │
│ │ │ 'README.md': '# Django API Project\n\n## Project Description\nThis project is a │ │
│ │ Django-based API '+279, │ │
│ │ │ ... +8 │ │
│ │ } │ │
│ │ self = <gpt_engineer.core.default.disk_execution_env.DiskExecutionEnv object at │ │
│ │ 0x7f6e1fd0d210> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/dawid/.local/lib/python3.10/site-packages/gpt_engineer/core/default/file_store.py:43 in │
│ push │
│ │
│ 40 │ │ for name, content in files.items(): │
│ 41 │ │ │ path = self.working_dir / name │
│ 42 │ │ │ path.parent.mkdir(parents=True, exist_ok=True) │
│ ❱ 43 │ │ │ with open(path, "w") as f: │
│ 44 │ │ │ │ f.write(content) │
│ 45 │ │ return self │
│ 46 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ content = '2. Create a virtual environment and activate it:' │ │
│ │ f = <_io.TextIOWrapper name='/tmp/gpt-engineer-ba464h2q/README.md' mode='w' │ │
│ │ encoding='UTF-8'> │ │
│ │ files = { │ │
│ │ │ 'app.': 'django-admin startproject api_project\ncd api_project\ndjango-admin │ │
│ │ startapp api_a'+2, │ │
│ │ │ 'api_app/models.py': 'from django.db import models\n\nclass │ │
│ │ Application(models.Model):\n name = models'+882, │ │
│ │ │ 'api_app/serializers.py': 'from rest_framework import serializers\nfrom │ │
│ │ .models import Application, Input, F'+507, │ │
│ │ │ 'api_app/views.py': 'from django.shortcuts import get_object_or_404\nfrom │ │
│ │ rest_framework import status'+3193, │ │
│ │ │ 'api_app/urls.py': "from django.urls import path\nfrom . import │ │
│ │ views\n\nurlpatterns = [\n path('auth"+486, │ │
│ │ │ 'api_project/settings.py': "INSTALLED_APPS = [\n ...\n │ │
│ │ 'rest_framework',\n 'api_app',\n 'django.cont"+530, │ │
│ │ │ 'api_app/admin.py': 'from django.contrib import admin\nfrom .models import │ │
│ │ Application, Scanner\n\nadmin'+56, │ │
│ │ │ 'migrations.': 'python manage.py makemigrations\npython manage.py migrate', │ │
│ │ │ 'panel.': 'python manage.py createsuperuser', │ │
│ │ │ 'README.md': '# Django API Project\n\n## Project Description\nThis project is │ │
│ │ a Django-based API '+279, │ │
│ │ │ ... +8 │ │
│ │ } │ │
│ │ name = 'api_project' │ │
│ │ path = PosixPath('/tmp/gpt-engineer-ba464h2q/api_project') │ │
│ │ self = <gpt_engineer.core.default.file_store.FileStore object at 0x7f6e1fd0c6d0> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IsADirectoryError: [Errno 21] Is a directory: '/tmp/gpt-engineer-ba464h2q/api_project'
System Information
No such option: --sysinfo
Python 3.10.12
Linux Mint 21
Installation Method
GPT-Engineer installed using pip install
.