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

Some Errors of MetaGPT-Generated applications I met #53

Closed
Hallimede opened this issue Jul 18, 2023 · 3 comments
Closed

Some Errors of MetaGPT-Generated applications I met #53

Hallimede opened this issue Jul 18, 2023 · 3 comments

Comments

@Hallimede
Copy link
Contributor

Hallimede commented Jul 18, 2023

Hi I am trying to use MetaGPT to generate some applications. However, I often come across issues regarding package dependency or ImportError when running those applications. So I can't even run the application successfully.

For example,

python startup.py "Write a diary web app called my_diary, where the user can keep record of everyday things."

The requirements of the generated app is

flask==1.1.2
flask_sqlalchemy==2.5.1
flask_wtf==0.14.3
flask_login==0.5.0
flask_bcrypt==0.7.1

When I run python main.py, the error is

Traceback (most recent call last):
  File "C:\Users\...\workspace\my_diary\my_diary\main.py", line 3, in <module>
    from flask import Flask, render_template, url_for, flash, redirect
  File "C:\Users\...\workspace\my_diary\env\Lib\site-packages\flask\__init__.py", line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (C:\Users\v-yaokangwu\Documents\LLM_CodeRevision\workspace\my_diary\env\Lib\site-packages\jinja2\__init__.py)

Another example,

python startup.py "Write a backend restful api based on FastAPI for course CRUD"

The requirements of the generated app is

fastapi==0.68.1
sqlalchemy==1.4.25
pydantic==1.8.2

When I run python main.py, the error is

Traceback (most recent call last):
  File "C:\Users\...\workspace\book_management_api\book_management_api\main.py", line 3, in <module>
    from fastapi import FastAPI, Depends, HTTPException
  File "C:\Users\...\workspace\book_management_api\env\Lib\site-packages\fastapi\__init__.py", line 7, in <module>
    from .applications import FastAPI as FastAPI
  File "C:\Users\...\workspace\book_management_api\env\Lib\site-packages\fastapi\applications.py", line 3, in <module>      
    from fastapi import routing
    ....
  File "C:\Users\...\workspace\book_management_api\env\Lib\site-packages\pydantic\main.py", line 369, in __new__
    cls.__signature__ = ClassAttribute('__signature__', generate_model_signature(cls.__init__, fields, config))
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\workspace\book_management_api\env\Lib\site-packages\pydantic\utils.py", line 231, in generate_model_signature
    merged_params[param_name] = Parameter(
                                ^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1008.0_x64__qbz5n2kfra8p0\Lib\inspect.py", line 2722, in __init__
    raise ValueError('{!r} is not a valid parameter name'.format(name))
ValueError: 'not' is not a valid parameter name

I wonder if you have also encountered issues like these.

@Hallimede
Copy link
Contributor Author

Hallimede commented Jul 18, 2023

I used gpt 4 and always ran the application in the virtual environment but I didn't configure SERPAPI_API_KEY during the process of generating these apps

@geekan
Copy link
Owner

geekan commented Jul 18, 2023

try python 3.9 instead. 3.11 is buggy..

@Hallimede Hallimede changed the title Some Eerrors of MetaGPT-Generated applications I met Some Errors of MetaGPT-Generated applications I met Jul 19, 2023
@Hallimede
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants