AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Latest Auto-gpt is broke on Debian 11

Open raymerjacque opened this issue 2 years ago • 10 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?

Linux

GPT-3 or GPT-4?

GPT-4

Steps to reproduce 🕹

python3 -m autogpt

Current behavior 😯

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/share/Auto-GPT/autogpt/main.py", line 5, in autogpt.cli.main() File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/Auto-GPT/autogpt/cli.py", line 77, in main from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/init.py", line 1, in from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/agent.py", line 3, in from autogpt.app import execute_command, get_command File "/usr/share/Auto-GPT/autogpt/app.py", line 10, in from autogpt.processing.text import summarize_text File "/usr/share/Auto-GPT/autogpt/processing/text.py", line 4, in import spacy File ""/home/usr/.local/lib/python3.11/site-packages/spacy/init.py", line 6, in from .errors import setup_default_warnings File ""/home/usr/.local/lib/python3.11/site-packages/spacy/errors.py", line 2, in from .compat import Literal File ""/home/usr/.local/lib/python3.11/site-packages/spacy/compat.py", line 3, in from thinc.util import copy_array File "/home/usr/.local/lib/python3.11/site-packages/thinc/init.py", line 5, in from .config import registry File ""/home/usr/.local/lib/python3.11/site-packages/thinc/config.py", line 1, in import catalogue File "/home/usr/.local/lib/python3.11/site-packages/catalogue/init.py", line 20, in AVAILABLE_ENTRY_POINTS = importlib_metadata.entry_points() # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1040, in entry_points return SelectableGroups.load(eps).select(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 476, in load ordered = sorted(eps, key=by_group) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1037, in eps = itertools.chain.from_iterable( ^ File "/usr/lib/python3.11/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) ^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 954, in _normalized_name or super().normalized_name ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 627, in normalized_name return Prepared.normalize(self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 882, in normalize return re.sub(r"[-.]+", "-", name).lower().replace('-', '') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/init.py", line 185, in sub return _compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType'

Expected behavior 🤔

expected to run correctly....

The specific seems to be a TypeError stating that it expected a string or bytes-like object, but got 'NoneType'. This error occurs when trying to perform a regular expression substitution using the re.sub function in the "/usr/lib/python3.11/re/init.py" file."

Please fix it.

Your prompt 📝

# Paste your prompt here

Your Logs 📒

<insert your logs here>

raymerjacque avatar Apr 21 '23 04:04 raymerjacque

Please provide logs and prompt

ntindle avatar Apr 21 '23 04:04 ntindle

Please provide logs and prompt

the logs and activity files are 0 bytes, they are empty. this error occurs when you start the app, it doesn't even start up long enough to make any logs.

and this is the prompt in terminal window :

`/usr/share/Auto-GPT$ python3 -m autogpt

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/share/Auto-GPT/autogpt/main.py", line 5, in autogpt.cli.main() File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/Auto-GPT/autogpt/cli.py", line 77, in main from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/init.py", line 1, in from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/agent.py", line 3, in from autogpt.app import execute_command, get_command File "/usr/share/Auto-GPT/autogpt/app.py", line 10, in from autogpt.processing.text import summarize_text File "/usr/share/Auto-GPT/autogpt/processing/text.py", line 4, in import spacy File "/home/user/.local/lib/python3.11/site-packages/spacy/init.py", line 6, in from .errors import setup_default_warnings File "/home/user/.local/lib/python3.11/site-packages/spacy/errors.py", line 2, in from .compat import Literal File "/home/user/.local/lib/python3.11/site-packages/spacy/compat.py", line 3, in from thinc.util import copy_array File "/home/user/.local/lib/python3.11/site-packages/thinc/init.py", line 5, in from .config import registry File "/home/user/.local/lib/python3.11/site-packages/thinc/config.py", line 1, in import catalogue File "/home/user/.local/lib/python3.11/site-packages/catalogue/init.py", line 20, in AVAILABLE_ENTRY_POINTS = importlib_metadata.entry_points() # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1040, in entry_points return SelectableGroups.load(eps).select(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 476, in load ordered = sorted(eps, key=by_group) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1037, in eps = itertools.chain.from_iterable( ^ File "/usr/lib/python3.11/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) ^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 954, in _normalized_name or super().normalized_name ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 627, in normalized_name return Prepared.normalize(self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 882, in normalize return re.sub(r"[-.]+", "-", name).lower().replace('-', '') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/init.py", line 185, in sub return _compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType'`

it worked before a few days ago, I updated today and got this error.

the system is running python 3.11 and all the packages in the requirements.txt file is installed without issues.

raymerjacque avatar Apr 21 '23 06:04 raymerjacque

Try using venv: cd /usr/share/Auto-GPT/ sudo apt install -y python3.11-venv python3 -m venv ./testvenv virtualenv testvenv source ./testvenv/bin/activate ./run.sh

k-boikov avatar Apr 21 '23 18:04 k-boikov

Try using venv: cd /usr/share/Auto-GPT/ sudo apt install -y python3.11-venv python3 -m venv ./testvenv virtualenv testvenv source ./testvenv/bin/activate ./run.sh

did not work, i still get the TypeError: expected string or bytes-like object, got 'NoneType'`

I think its because they updated to python 3.10 and implemented it poorly... I don't know why they did that, so many operating systems and many linux distros still run on 3.8.

raymerjacque avatar Apr 22 '23 06:04 raymerjacque

I narrowed it down, this is the commit that broke everything :

https://github.com/Significant-Gravitas/Auto-GPT/commit/fa91bc154c239f569346d72e81e5b11b24267413

everything was working before this commit. the changes made in autogpt/processing/text.py in this commit is faulty.

raymerjacque avatar Apr 22 '23 06:04 raymerjacque

the problem is spaCy, it is not compatible with some Python3.11 builds. a easy solution is to use nltk instead of spaCy, this works, I have modified the code and tested it.

here is a Fix :

text.zip

please add this to the github, as I do not have access to add files. also add nltk to the requirements file. this has been tested in Debian 11 using python 3.11

it goes into the /autogpt/processing/ directory.

raymerjacque avatar Apr 22 '23 07:04 raymerjacque

I was mentioned in this thread and asked to fix the issue. But unfortunately, I am not the "batyu" who made this commit so I am afraid that I cannot help.

I narrowed it down, this is the commit that broke everything :

fa91bc1

everything was working before this commit. the changes made in autogpt/processing/text.py in this commit is faulty.

zh1yu4nyu avatar Apr 22 '23 15:04 zh1yu4nyu

the changes made in autogpt/processing/text.py in this commit is faulty.

@raymerjacque please explain clearly what part of the code is faulty when making this kind of claims.

I see the accusatory comment in which I was pinged (not sure by whom) has been removed, but still do not appreciate the way we are being approached. We are under no obligation to be helpful towards people who give us that kind of crap.

Our priority is with stabilizing the codebase. We will get to supporting everyone and everything once that is done. Submitting inflammatory or demanding issues is not going to speed it up.

Re: Python version

The availability of Python 3.10 to users is not a significant problem, judging from incoming issues and questions. Some users have older python versions installed, but they always manage to upgrade as far as we can tell.

Furthermore, we run CI with Python 3.10 and 3.11. If you think this crash is caused by 3.11, please provide more info on the environment/platform/device on which you try to run it, because it works fine in our CI.

Finally, the instructions clearly say to run ./run.sh. Try following the instructions, that makes it easier for us to provide you with support.

Pwuts avatar Apr 22 '23 19:04 Pwuts

SpaCy is buggy on Python 3.11 on Debian. you implemented spaCy into the text.py and as a result i get this error when starting autgpt :

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/share/Auto-GPT/autogpt/main.py", line 5, in autogpt.cli.main() File "/usr/lib/python3/dist-packages/click/core.py", line 1130, in call return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/Auto-GPT/autogpt/cli.py", line 77, in main from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/init.py", line 1, in from autogpt.agent.agent import Agent File "/usr/share/Auto-GPT/autogpt/agent/agent.py", line 3, in from autogpt.app import execute_command, get_command File "/usr/share/Auto-GPT/autogpt/app.py", line 10, in from autogpt.processing.text import summarize_text File "/usr/share/Auto-GPT/autogpt/processing/text.py", line 4, in import spacy File "/home/user/.local/lib/python3.11/site-packages/spacy/init.py", line 6, in from .errors import setup_default_warnings File "/home/user/.local/lib/python3.11/site-packages/spacy/errors.py", line 2, in from .compat import Literal File "/home/user/.local/lib/python3.11/site-packages/spacy/compat.py", line 3, in from thinc.util import copy_array File "/home/user/.local/lib/python3.11/site-packages/thinc/init.py", line 5, in from .config import registry File "/home/user/.local/lib/python3.11/site-packages/thinc/config.py", line 1, in import catalogue File "/home/user/.local/lib/python3.11/site-packages/catalogue/init.py", line 20, in AVAILABLE_ENTRY_POINTS = importlib_metadata.entry_points() # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1040, in entry_points return SelectableGroups.load(eps).select(**params) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 476, in load ordered = sorted(eps, key=by_group) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 1037, in eps = itertools.chain.from_iterable( ^ File "/usr/lib/python3.11/importlib/metadata/_itertools.py", line 16, in unique_everseen k = key(element) ^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 954, in _normalized_name or super().normalized_name ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 627, in normalized_name return Prepared.normalize(self.name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/metadata/init.py", line 882, in normalize return re.sub(r"[-.]+", "-", name).lower().replace('-', '') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/re/init.py", line 185, in sub return _compile(pattern, flags).sub(repl, string, count) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType'`

If i replace spaCy with nltk, the error no longer appears.

Please fix your code. or i will go into the actual Commit and make a comment on it there.

raymerjacque avatar Apr 24 '23 04:04 raymerjacque

This issue is still not fixed and this commit is still in the repo... This is a serious problem for Debian 11 users running python3.11. it's been days now and other than a few comments no one seems interested in fixing it.

raymerjacque avatar Apr 24 '23 09:04 raymerjacque

You seem to be the only one having this issue. It's not that we don't want to help you, despite your rudeness, but since no-one else has reported this problem, this might as well be an issue with your setup which is hard to debug for us. Try running it in docker.

Pwuts avatar Apr 26 '23 08:04 Pwuts

This seems to be the same issue https://github.com/python/importlib_metadata/issues/403#issuecomment-1230270650

Pwuts avatar Apr 26 '23 08:04 Pwuts

i fixed it myself loooong ago. i merely asked you guys to fix it for others.

raymerjacque avatar Apr 26 '23 08:04 raymerjacque