AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

TypeError: 'type' object is not subscriptable

Open WillFrasier opened this issue 2 years ago • 5 comments

⚠️ Search for existing issues first ⚠️

  • [X] I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Windows

Which version of Auto-GPT are you using?

Latest Release

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

  1. Download a new enlistment on Windows 11
  2. Open too dir with VS Code
  3. Change .env.template to '.env` and add my open ai key
  4. pip install -r requirements.txt
  5. python -m autogpt

Current behavior 😯

I get this output:

Traceback (most recent call last):
  File "C:\Users\willf\Anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\willf\Anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\git\autogpt\1\Auto-GPT\autogpt\__main__.py", line 5, in <module>
    autogpt.cli.main()
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\core.py", line 1635, in invoke
    rv = super().invoke(ctx)
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\willf\Anaconda3\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\git\autogpt\1\Auto-GPT\autogpt\cli.py", line 87, in main
    from autogpt.main import run_auto_gpt
  File "C:\git\autogpt\1\Auto-GPT\autogpt\main.py", line 8, in <module>
    from autogpt.agent.agent import Agent
  File "C:\git\autogpt\1\Auto-GPT\autogpt\agent\__init__.py", line 1, in <module>
    from autogpt.agent.agent import Agent
  File "C:\git\autogpt\1\Auto-GPT\autogpt\agent\agent.py", line 3, in <module>
    from autogpt.app import execute_command, get_command
  File "C:\git\autogpt\1\Auto-GPT\autogpt\app.py", line 5, in <module>
    from autogpt.agent.agent_manager import AgentManager
  File "C:\git\autogpt\1\Auto-GPT\autogpt\agent\agent_manager.py", line 7, in <module>
    from autogpt.llm_utils import create_chat_completion
  File "C:\git\autogpt\1\Auto-GPT\autogpt\llm_utils.py", line 11, in <module>
    from autogpt.api_manager import api_manager
  File "C:\git\autogpt\1\Auto-GPT\autogpt\api_manager.py", line 6, in <module>
    from autogpt.logs import logger
  File "C:\git\autogpt\1\Auto-GPT\autogpt\logs.py", line 14, in <module>
    from autogpt.speech import say_text
  File "C:\git\autogpt\1\Auto-GPT\autogpt\speech\__init__.py", line 2, in <module>
    from autogpt.speech.say import say_text
  File "C:\git\autogpt\1\Auto-GPT\autogpt\speech\say.py", line 34, in <module>
    def _get_voice_engine(config: Config) -> tuple[VoiceBase, VoiceBase]:
TypeError: 'type' object is not subscriptable

Expected behavior 🤔

Auto GPT Prompt

Your prompt 📝

NA

Your Logs 📒

No logs, just the output above

WillFrasier avatar Apr 26 '23 02:04 WillFrasier

In case it helps, here's the output of my pip list command. pip_list.txt

WillFrasier avatar Apr 26 '23 02:04 WillFrasier

Same issue happened on my side as well.

Update: Was python 3.8.10. Issue is resolved after update to python 3.11.3. Credit to @MattiasHaughom . Thank you!!

leizhao3 avatar Apr 26 '23 07:04 leizhao3

Python version?

ntindle avatar Apr 26 '23 09:04 ntindle

I had this issue myself but it was solved by updating my Python 3.8.10 to the newest 3.11.3 release.

MattiasHaughom avatar Apr 26 '23 09:04 MattiasHaughom

It seems like there is a missing from __future__ import annotations in the head of file autogpt\speech\say.py. Typing as tuple[something] is available in Python 3.9 or greater. For example, see https://github.com/Significant-Gravitas/Auto-GPT/blob/master/autogpt/agent/agent_manager.py#L122 and the first line.

mateusz-wozny avatar Apr 26 '23 17:04 mateusz-wozny

Same issue happened on my side as well.

Update: Was python 3.8.10. Issue is resolved after update to python 3.11.3. Credit to @MattiasHaughom . Thank you!!

Same this side. A quick update did the trick. Thank You!

InimitableF avatar Apr 30 '23 17:04 InimitableF

I see this issue is closed, but as i got the same problem (TypeError: 'type' object is not subscriptable ) than WillFrasier up, and i can't actually update my python :-( (because running on Win 7, my python is : Microsoft Windows [version 6.1.7601] C:\Users\xx\a_python>python --version Python 3.8.10 C:\Users\xx\a_python>pip --version pip 21.1.1 from c:\users\xx\chatgpt-clone\venv\lib\site-packages\pip (python 3.8) ).

my traceback : " D:\chatgpt_code>python main.py Traceback (most recent call last): File "main.py", line 1, in from autogpt import main File "D:\chatgpt_code\autogpt\main.py", line 8, in from autogpt.agent.agent import Agent File "D:\chatgpt_code\autogpt\agent_init_.py", line 1, in from autogpt.agent.agent import Agent File "D:\chatgpt_code\autogpt\agent\agent.py", line 5, in from autogpt.app import execute_command, get_command File "D:\chatgpt_code\autogpt\app.py", line 5, in from autogpt.agent.agent_manager import AgentManager File "D:\chatgpt_code\autogpt\agent\agent_manager.py", line 7, in from autogpt.llm import Message, create_chat_completion File "D:\chatgpt_code\autogpt\llm_init_.py", line 1, in from autogpt.llm.api_manager import ApiManager File "D:\chatgpt_code\autogpt\llm\api_manager.py", line 7, in from autogpt.logs import logger File "D:\chatgpt_code\autogpt\logs.py", line 14, in from autogpt.speech import say_text File "D:\chatgpt_code\autogpt\speech_init_.py", line 2, in from autogpt.speech.say import say_text File "D:\chatgpt_code\autogpt\speech\say.py", line 34, in def _get_voice_engine(config: Config) -> tuple[VoiceBase, VoiceBase]: TypeError: 'type' object is not subscriptable "

Trying to dig the traceback, i ran the first main in the autogpt directory and got this in cmd :

" D:\chatgpt_code>cd autogpt

D:\chatgpt_code\autogpt>python main.py Traceback (most recent call last): File "main.py", line 8, in from autogpt.agent.agent import Agent ModuleNotFoundError: No module named 'autogpt' "

Someone would explain me why this main.py can't run in D:\chatgpt_code\autogpt> ? It looks like access to autogpt directory in not possible !

If that can help those trying to run autogpt in win 7, many people would thank :-)

seeeerge avatar May 14 '23 02:05 seeeerge

i got the same problem [...], and i can't actually update my python :-(

@seeeerge sorry, but that isn't something we can solve for you. The Python 3.10 requirement is there for a reason and there is no simple workaround to make Auto-GPT work with older Python versions.

What you could try is running Auto-GPT in Docker, see the documentation for specific instructions on that.

Pwuts avatar May 30 '23 16:05 Pwuts

‌Thank you for your answer :-)

I finally succeeded to install version 0.2.0 in VSC & Dev Container (with this tutorial : com/watch?v=1cQoPwLkASM ) but was disappointed by the first prompt... :-(

Anyway i will update my win 7 system to win 10 (my CPU can't support 11)  

De : "Reinier van der Leer" A : "Significant-Gravitas/Auto-GPT" ,"seeeerge" ,"Mention" Envoyé: mardi 30 Mai 2023 23:11 Objet : Re: [Significant-Gravitas/Auto-GPT] TypeError: 'type' object is not subscriptable (Issue #3280)  

 

i got the same problem [...], and i can't actually update my python :-(

@seeeerge sorry, but that isn't something we can solve for you. The system requirements are clear about the Python 3.10 requirement.

What you could try is running Auto-GPT in Docker, see the documentation for specific instructions on that.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

seeeerge avatar May 31 '23 02:05 seeeerge