Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

AttributeError: 'dict' object has no attribute 'is_enabled' #213

Open
starascendin opened this issue Jun 28, 2023 · 11 comments
Open

AttributeError: 'dict' object has no attribute 'is_enabled' #213

starascendin opened this issue Jun 28, 2023 · 11 comments

Comments

@starascendin
Copy link

/Auto-GPT/autogpt/plugins/__init__.py", line 272, in scan_plugins
    plugin_enabled = plugins_config.is_enabled(plugin_name)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'is_enabled'

Hi i've been trying to install and run plugins, and i've been getting this error no matter what I try.
I am running on stable branch, and followed the readme in this repo.

Anyone know what im doing wrong?

@tootallderr
Copy link

same

@andresrex
Copy link

Yeah, all the plugins are breaking....

@andresrex
Copy link

And breaking badly. Ive been trying everything for the past 3/4 days and nothing, this is not maintainable. If anyone knows a better and well maintained option, please let me know! Cheers

@TyJoeRoll
Copy link

I installed plug-ins and it broke my auto gpt. Any fixes? Maybe I installed something wrong? I'm getting ready to delete everything and restart

@yangziyu-620
Copy link

same

@andresrex
Copy link

I installed plug-ins and it broke my auto gpt. Any fixes? Maybe I installed something wrong? I'm getting ready to delete everything and restart

Bro, don’t bother. You will get the exact same errors, I’ve been trying to make it work for the last days and nothing works.

@Architect007au
Copy link

Same error here, any updates?

@ns-sdotson
Copy link

ns-sdotson commented Jul 5, 2023

I'm running into the same problem, and I'm doing this from a fresh install. My assumption is that the plugins at this stage are totally broken, and there's not much we can do until a fix is pushed.

I asked ChatGPT4 what the issue was, and it said (using the webpilot plugin):

The error you're encountering seems to be related to the plugin loading process in Auto-GPT. The error message suggests that there's an issue with the scan_plugins function in the init.py file of the plugins directory.

The scan_plugins function is responsible for loading all the plugins. It looks for plugins in the plugins directory, and for each plugin it finds, it checks if it's enabled in the plugins_config.yaml file. If the plugin is enabled, it's loaded and added to the list of loaded plugins.

The error message you're seeing, AttributeError: 'AnsiFore' object has no attribute 'name'. Did you mean: 'ne'?, suggests that there's an issue with the a_module.name attribute. This attribute is supposed to contain the name of the module, but for some reason, it's not available.

The a_module variable is supposed to be a module object representing a plugin. It's obtained by using the getattr function on the zipped_module object with the key argument, where key is a string representing the name of an attribute of the zipped_module object. The zipped_module object, in turn, is a module object representing the plugin module loaded from a zip file.

The error message suggests that a_module is an AnsiFore object, not a module object. AnsiFore is a class from the colorama package, which is used for colored terminal text. It's not clear why a_module would be an AnsiFore object, as it's supposed to be a module object.

This issue might be due to a problem with the plugin zip file, or it could be a bug in the Auto-GPT code. It might be helpful to check the contents of the plugin zip file to make sure it contains a valid Python module. If the zip file seems to be okay, you might want to report this issue to the Auto-GPT developers.

@CuplexUser
Copy link

You can get around the problem completely and run your plugins as usual if you comment out 3 lines of code in the init plugins python file:
# if not plugins_config.is_enabled(plugin_module_name):
# logger.warn(f"Plugin {plugin_module_name} found but not configured")
# continue
This will of course enable all your plugins in the plugins zip file(s). And the plugin setting configuration must exist in the .env file. I just removed it and had to copy it back from "plugins_config.yaml"

So basically both the new and the old plugin system are implemented at the same time, and it seems like the new plugin config file system is almost in place. Just have instantiate the PluginsConfig class like in the tests.

@eisy
Copy link

eisy commented Jul 8, 2023

You can get around the problem completely and run your plugins as usual if you comment out 3 lines of code in the init plugins python file: # if not plugins_config.is_enabled(plugin_module_name): # logger.warn(f"Plugin {plugin_module_name} found but not configured") # continue This will of course enable all your plugins in the plugins zip file(s). And the plugin setting configuration must exist in the .env file. I just removed it and had to copy it back from "plugins_config.yaml"

So basically both the new and the old plugin system are implemented at the same time, and it seems like the new plugin config file system is almost in place. Just have instantiate the PluginsConfig class like in the tests.

that's strange, the init plugins python file is empty. it's a blank text file with no content. i couldn't find another such file. how do you do that?

@Architect007au
Copy link

No solution yet here, _ tried the above and didn't work_

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

No branches or pull requests

9 participants