AutoGPT
AutoGPT copied to clipboard
Dependency Conflict with Requests in googlesearch-python and tiktoken
Issue:
There is a dependency conflict involving the requests package between googlesearch-python
and other packages in the project. The googlesearch-python
package has a strict dependency on a specific version of requests, which is causing the conflict. the tiktoken
and googlesearch-python
packages seem to be conflicting.
Using python 3.10
Details:
The conflict is caused by:
The user requested requests>=2.26.0
openai 0.27.2 depends on requests>=2.20
tiktoken 0.3.3 depends on requests>=2.26.0
docker 2.0.0 depends on requests!=2.11.0, !=2.12.2 and >=2.5.2
googlesearch-python 1.1.0 depends on requests==2.25.1
The user requested requests>=2.26.0
openai 0.27.2 depends on requests>=2.20
tiktoken 0.3.3 depends on requests>=2.26.0
docker 2.0.0 depends on requests!=2.11.0, !=2.12.2 and >=2.5.2
googlesearch-python 1.0.1 depends on requests==2.25.1
The user requested requests>=2.26.0
openai 0.27.2 depends on requests>=2.20
tiktoken 0.3.3 depends on requests>=2.26.0
docker 2.0.0 depends on requests!=2.11.0, !=2.12.2 and >=2.5.2
googlesearch-python 1.0.0 depends on requests==2.24.0
or when trying to pin specific versions:
The conflict is caused by:
The user requested requests
openai 0.27.2 depends on requests>=2.20
tiktoken 0.3.3 depends on requests>=2.26.0
googlesearch-python 1.1.0 depends on requests==2.25.1
Please let me know if there are any plans to address this issue or if you need any additional information.
Yeah some version pining would be great too... I see a lot of unpinned versions
I'm getting the same error
Duplicate of #30
The problem is not tiktoken, but googlesearch-python. I've just created a PR containing a workaround, using tomviner's PR on googlesearch which loosened its requirements
Try if this fixes your problem: https://github.com/Torantulino/Auto-GPT/pull/86
https://github.com/Torantulino/Auto-GPT/pull/86 this one is working well !
Someone on Discord suggested this that worked for me: git+https://github.com/tomviner/googlesearch@loosen-requirements#googlesearch-python
To resolve this dependency conflict, you can try the following steps:
1)Use a virtual environment to isolate the project dependencies from other Python installations on your system.
2)Uninstall the conflicting packages that are not needed for your project.
3)Install the required versions of requests and googlesearch-python packages in your virtual environment using pip.
Here are the steps in more detail:
1)Create a virtual environment:
Copy code
python -m venv myenv
2)Activate the virtual environment:
bash
Copy code
source myenv/bin/activate # on Linux or macOS
myenv\Scripts\activate.bat # on Windows
3)Uninstall the conflicting packages:
Copy code
pip uninstall tiktoken docker
4)Install the required versions of requests and googlesearch-python packages:
Copy code
pip install requests==2.25.1 googlesearch-python
If you still need tiktoken and docker packages, you can try installing them with the same version of requests as googlesearch-python:
Copy code
pip install tiktoken docker requests==2.25.1
Alternatively, you can try updating the dependencies of the conflicting packages to use a compatible version of requests. However, this may not always be possible or practical, especially if the conflicting packages have strict dependency requirements.
To resolve this dependency conflict, you can try the following steps:
1)Use a virtual environment to isolate the project dependencies from other Python installations on your system.
2)Uninstall the conflicting packages that are not needed for your project.
3)Install the required versions of requests and googlesearch-python packages in your virtual environment using pip.
Here are the steps in more detail:
1)Create a virtual environment: Copy code
python -m venv myenv
2)Activate the virtual environment: bash Copy codesource myenv/bin/activate # on Linux or macOS
myenv\Scripts\activate.bat # on Windows
3)Uninstall the conflicting packages: Copy codepip uninstall tiktoken docker
4)Install the required versions of requests and googlesearch-python packages: Copy codepip install requests==2.25.1 googlesearch-python
If you still need tiktoken and docker packages, you can try installing them with the same version of requests as googlesearch-python:Copy code
pip install tiktoken docker requests==2.25.1
Alternatively, you can try updating the dependencies of the conflicting packages to use a compatible version of requests. However, this may not always be possible or practical, especially if the conflicting packages have strict dependency requirements.
Still Getting the following error on Mac
Collecting requests==2.25.1 Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB) Collecting googlesearch-python Using cached googlesearch-python-1.2.0.tar.gz (7.4 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
Currently, the latest master branch no longer has this problem. git pull
or re git clone
the repo and pip install --user -r requirements.txt
.
To pin or not to pin Still not sure what's best here I'm going with: only pin when we need to We're now using poetry which should sort this out for us.