MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

TypeError: '>' not supported between instances of 'str' and 'int'

Open daniellopez-2 opened this issue 2 years ago • 11 comments
trafficstars

getting this error below with the command: python startup.py “write a python SEO Checker app” -code_review True

my SERPAPI_API_KEY and OPENAI_API_KEY are set.

2023-09-03 10:45:54.926 | INFO | metagpt.config:init:44 - Config loading done. 2023-09-03 10:45:59.907 | INFO | metagpt.software_company:invest:39 - Investment: $a. Traceback (most recent call last): File "/Users/daniellv/metagpt/startup.py", line 68, in fire.Fire(main) File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/site-packages/fire/core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( ^^^^^^^^^^^^^^^^^^^^ File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/daniellv/metagpt/startup.py", line 63, in main asyncio.run(startup(idea, investment, n_round, File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/daniellv/opt/anaconda3/envs/metagpt/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/daniellv/metagpt/startup.py", line 40, in startup await company.run(n_round=n_round) File "/Users/daniellv/metagpt/metagpt/software_company.py", line 55, in run while n_round > 0: ^^^^^^^^^^^ TypeError: '>' not supported between instances of 'str' and 'int'

daniellopez-2 avatar Sep 03 '23 16:09 daniellopez-2

Try to use python3.9.x

voidking avatar Sep 04 '23 14:09 voidking

@voidking I'm using python 3.11.4 and am having this same issue.

Glenncito avatar Sep 04 '23 14:09 Glenncito

@voidking I'm using python 3.11.4 and am having this same issue.

Try to use python3.9.x

voidking avatar Sep 04 '23 14:09 voidking

Still not working for me, using py 3.9.4

yoman38 avatar Sep 05 '23 08:09 yoman38

Still not working for me, using py 3.9.4

git pull
pip install -r requirements.txt

Then try again please.

voidking avatar Sep 05 '23 09:09 voidking

Thanks for your help; unfortunately: (metagpt) C:\Users<your_username>\Documents\MetaGPT>git pull Already up to date.

(metagpt) C:\Users<your_username>\Documents\MetaGPT>pip install -r requirements.txt Requirement already satisfied: aiohttp==3.8.4 in C:\Users<your_username>\AppData\Local\Anaconda3\envs\metagpt\lib\site-packages (from -r requirements.txt (line 1)) (3.8.4) Requirement already satisfied: channels==4.0.0 in C:\Users<your_username>\AppData\Local\Anaconda3\envs\metagpt\lib\site-packages (from -r requirements.txt (line 3)) (4.0.0) ... Requirement already satisfied: hpack<5,>=4.0 in C:\Users<your_username>\AppData\Local\Anaconda3\envs\metagpt\lib\site-packages (from h2<5,>=3->httpx<1,>=0.23.0->anthropic==0.3.6->-r requirements.txt (line 36)) (4.0.0) Requirement already satisfied: h11<0.15,>=0.13 in C:\Users<your_username>\AppData\Local\Anaconda3\envs\metagpt\lib\site-packages (from httpcore<0.18.0,>=0.15.0->httpx<1,>=0.23.0->anthropic==0.3.6->-r requirements.txt (line 36)) (0.14.0)

I also tried a new clean install; a new env in VS code but I always get this error

yoman38 avatar Sep 05 '23 10:09 yoman38

I'm not sure if this will help but... After installing py 3.9.11 I was still getting the error. I started printing out the values that the code was complaining about (n_round in this case). It was set to one of the characters in my prompt. I enclosed the prompt in quotations (even though Matthew Berman's tutorial stated that this wasn't necessary) and then the problem disappeared.

Glenncito avatar Sep 05 '23 10:09 Glenncito

I'm not sure if this will help but... After installing py 3.9.11 I was still getting the error. I started printing out the values that the code was complaining about (n_round in this case). It was set to one of the characters in my prompt. I enclosed the prompt in quotations (even though Matthew Berman's tutorial stated that this wasn't necessary) and then the problem disappeared.

Yes, the --n_round should be set to a number. But @daniellopez-2 didn't use the arg.

@yoman38 What command did you execute?

voidking avatar Sep 05 '23 10:09 voidking

I'm not sure if this will help but... After installing py 3.9.11 I was still getting the error. I started printing out the values that the code was complaining about (n_round in this case). It was set to one of the characters in my prompt. I enclosed the prompt in quotations (even though Matthew Berman's tutorial stated that this wasn't necessary) and then the problem disappeared.

How stupid I am... It didn't work because in my prompt there was python startup.py "beginning of my prompt, a name between quotes like "Alice" then the end of the pronpt" The quotes in between quotes lead to the error in my case

yoman38 avatar Sep 05 '23 11:09 yoman38

Make sure you escape single or double quotes.

aemilcar avatar Sep 08 '23 17:09 aemilcar

@daniellopez-2 try

python startup.py "write a python SEO Checker app" --code_review True

your command uses wrong double quotes, what you use is Chinese quotation marks.

alitrack avatar Sep 19 '23 07:09 alitrack