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

Command browse_website fails on Python 3.10 due to Beautiful Soup 4 #2514

Closed
1 task done
peterbanda opened this issue Apr 19, 2023 · 8 comments · Fixed by #2680
Closed
1 task done

Command browse_website fails on Python 3.10 due to Beautiful Soup 4 #2514

peterbanda opened this issue Apr 19, 2023 · 8 comments · Fixed by #2680

Comments

@peterbanda
Copy link
Contributor

⚠️ Search for existing issues first ⚠️

  • 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 🕹

Python Version: 3.10.11
Beautiful Soup 4 Version: 4.6.0

python3.10 -m autogpt

Goal can be anything that requires Google search and web browsing.

Current behavior 😯

Site browsing/parsing fails with module 'collections' has no attribute 'Callable'

Expected behavior 🤔

I was able to fix the issue by following: https://stackoverflow.com/questions/69515086/error-attributeerror-collections-has-no-attribute-callable-using-beautifu

In particular, added the following imports to the file web_selenium.py before from bs4 import BeautifulSoup

import collections
import collections.abc

collections.Callable = collections.abc.Callable

I can provided PR for that if needed.

Your prompt 📝

N/A

Your Logs 📒

2023-04-19 10:22:02,603 INFO NEXT ACTION:  COMMAND = browse_website  ARGUMENTS = {'url': 'https://www.futuremarketinsights.com/reports/contract-lifecycle-management-market', 'question': 'What are the key findings of the report?'}
2023-04-19 10:22:31,913 INFO -=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-= 
2023-04-19 10:22:39,458 INFO SYSTEM:  Command browse_website returned: Error: module 'collections' has no attribute 'Callable'
@sadmuphin sadmuphin added the bug Something isn't working label Apr 19, 2023
peterbanda added a commit to peterbanda/Auto-GPT that referenced this issue Apr 19, 2023
@peterbanda
Copy link
Contributor Author

Hey folks,

I can now confirm the following.
The issue appears on Python 3.10 (3.10.11) as well as 3.11 (3.11.3), and on both, the master branch and the last stable release - version 0.2.1.

In all four cases adding the lines I mentioned above fixes the issue 🎉

@peterbanda
Copy link
Contributor Author

Created a PR for the issue: #2596

@Pwuts
Copy link
Member

Pwuts commented Apr 20, 2023

Is this still broken in branch 0.2.2-test2?

@peterbanda
Copy link
Contributor Author

Hey @Pwuts,

I've just tested it on 0.2.2-stable (the latest release) and 0.2.2-test and the issue still occurs (tried Python3.10/3.11).
Anyway, after applying the proposed fix, the issue disappeared in all the cases.

@Pwuts
Copy link
Member

Pwuts commented Apr 20, 2023

Strange. What's your setup (OS/platform)?

I'm asking because browsing works fine on most setups, except on Apple M1 and ARM-based devices because of missing drivers (#2600 #2219).

@peterbanda
Copy link
Contributor Author

Hi,

I use Ubuntu/Linux, but actually I just found a better/more elegant solution.

Simply upgrade Beautiful Soup4 to the latest version:

pip install beautifulsoup4==4.12.2

My previous version was 4.6.0.

Tested on Auto-GPT master, 0.2.1, 0.2.2, and 0.2.2-test with Python 3.10/3.11. Worked like charm 🎉!

Will provide a new PR for that.

peterbanda added a commit to peterbanda/Auto-GPT that referenced this issue Apr 20, 2023
…' command to fail on Python 3.10 and 3.11. Closes Significant-Gravitas#2514. Simplified version of the fix.
@peterbanda
Copy link
Contributor Author

PR #2680 created... ready to roll 🎉

@Pwuts
Copy link
Member

Pwuts commented Apr 20, 2023

Nice, thanks!

@Pwuts Pwuts linked a pull request Apr 20, 2023 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants