Closed omlinky closed 8 months ago
This is unrelated to Uvicorn, there are many libraries that are not building with Python 3.12. Here Uvicorn is not installed to your venv because the installation stopped when the error for aiohttp
came. There's an issue created for this [link], changing the version to 3.9.0b0
would solve this, but there are multiple libraries not building with 3.12.
My solution was to change my Python version to Python 3.10, you can easily do it using pyenv
[pyenv], $pyenv install 3.10.0
and then $pyenv global 3.10.0
. Now clear the pycache or just delete the repo and clone it again. Do the initial setup, by running ./setup.sh
and then create your agent ./run agent create YOUR_AGENT_NAME
. Before starting your agent, go to the folder AutoGPT/autogpts/{Your_Agent_Name}
, open the pyproject.toml
file in an editor and change this line python = "^3.10"
to python = "3.10"
, earlier it would fetch the version greater than 3.10, so now Python 3.10 will be used for your poetry environment instead of 3.12. Running ./run agent start YOUR_AGENT_NAME
will now work. Don't forget to add your OpenAI API key to .env file.
I get the same issue running on Gitpod:
Command not found: agbenchmark
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/workspace/AutoGPT/autogpts/MrBrain/forge/__main__.py", line 3, in <module>
import uvicorn
ModuleNotFoundError: No module named 'uvicorn'
digging deeper, I found the issue related to a version of aiohttp
:
• Installing aiohttp (3.8.6): Failed
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
*********************
* Accelerated build *
*********************
running bdist_wheel
running build
running build_py
...
@abmallick This workaround works for me! Thanks!
@abmallick This workaround works for me too! Thanks!
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.
same issue, i could not fix
import uvicorn
ModuleNotFoundError: No module named 'uvicorn'
UPDATE I needed to tell poetry to use python 3.10.0 and run poetry updates again. Steps below:
poetry env use 3.10.0
poetry lock --no-update
poetry install
./run agent start YOUR_AGENT_NAME
This is unrelated to Uvicorn, there are many libraries that are not building with Python 3.12. Here Uvicorn is not installed to your venv because the installation stopped when the error for
aiohttp
came. There's an issue created for this [link], changing the version to3.9.0b0
would solve this, but there are multiple libraries not building with 3.12.My solution was to change my Python version to Python 3.10, you can easily do it using
pyenv
[pyenv],$pyenv install 3.10.0
and then$pyenv global 3.10.0
. Now clear the pycache or just delete the repo and clone it again. Do the initial setup, by running./setup.sh
and then create your agent./run agent create YOUR_AGENT_NAME
. Before starting your agent, go to the folderAutoGPT/autogpts/{Your_Agent_Name}
, open thepyproject.toml
file in an editor and change this linepython = "^3.10"
topython = "3.10"
, earlier it would fetch the version greater than 3.10, so now Python 3.10 will be used for your poetry environment instead of 3.12. Running./run agent start YOUR_AGENT_NAME
will now work. Don't forget to add your OpenAI API key to .env file.
@abmallick this did not work for me. details below. any further updates on this? i have also tried on 3.11 with the same results.
Description: Kali GNU/Linux Rolling Release: 2024.2 Codename: kali-rolling Kernel: Linux 6.5.0-kali3-amd64
Using python3 (3.10.0)
Traceback (most recent call last):
File "/home/monstorbak/.pyenv/versions/3.10.0/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/monstorbak/.pyenv/versions/3.10.0/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/monstorbak/AgentSmith/agents/AgentSmith/forge/main.py", line 4, in
3. poetry install
I am facing the same issue
Same issue happening here.
import uvicorn
ModuleNotFoundError: No module named 'uvicorn'
Traceback (most recent call last):
And same issue happening here too.
./run setup
pip install poetry uvicorn
pip install -r docs/requirements.txt
did not help.
⚠️ Search for existing issues first ⚠️
Which Operating System are you using?
Windows
Which version of AutoGPT are you using?
Latest Release
Do you use OpenAI GPT-3 or GPT-4?
GPT-3.5
Which area covers your issue best?
Installation and setup
Describe your issue.
Hello. When I try to run my agent the program gives me error:
`./run agent start YOUR_AGENT_NAME No poetry environment found. Creating virtualenv autogpt-forge-Oxbwsjq6-py3.12 in /Users/user/Library/Caches/pypoetry/virtualenvs Installing dependencies from lock file
Package operations: 156 installs, 0 updates, 0 removals Backend subprocess exited when trying to invoke build_wheel
running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-universal2-cpython-312 creating build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_ws.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/worker.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/multipart.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_response.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/client_ws.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/test_utils.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/tracing.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_exceptions.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_middlewares.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/http_exceptions.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_app.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/streams.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_protocol.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/log.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/client.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_urldispatcher.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_request.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/http_websocket.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/client_proto.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/locks.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/init.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_runner.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_server.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/base_protocol.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/payload.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/client_reqrep.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/http.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_log.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/resolver.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/formdata.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/payload_streamer.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_routedef.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/connector.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/client_exceptions.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/typedefs.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/hdrs.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/web_fileresponse.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/http_writer.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/tcp_helpers.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/helpers.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/http_parser.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/cookiejar.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/pytest_plugin.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/abc.py -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp running egg_info writing aiohttp.egg-info/PKG-INFO writing dependency_links to aiohttp.egg-info/dependency_links.txt writing requirements to aiohttp.egg-info/requires.txt writing top-level names to aiohttp.egg-info/top_level.txt reading manifest file 'aiohttp.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'aiohttp' anywhere in distribution warning: no previously-included files matching '.pyc' found anywhere in distribution warning: no previously-included files matching '.pyd' found anywhere in distribution warning: no previously-included files matching '.so' found anywhere in distribution warning: no previously-included files matching '.lib' found anywhere in distribution warning: no previously-included files matching '.dll' found anywhere in distribution warning: no previously-included files matching '.a' found anywhere in distribution warning: no previously-included files matching '.obj' found anywhere in distribution warning: no previously-included files found matching 'aiohttp/.html' no previously-included directories found matching 'docs/_build' adding license file 'LICENSE.txt' writing manifest file 'aiohttp.egg-info/SOURCES.txt' copying aiohttp/_cparser.pxd -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_find_header.pxd -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_headers.pxi -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_helpers.pyi -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_helpers.pyx -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_http_parser.pyx -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_http_writer.pyx -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/_websocket.pyx -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp copying aiohttp/py.typed -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp creating build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_cparser.pxd.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_find_header.pxd.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_helpers.pyi.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_helpers.pyx.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_http_parser.pyx.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_http_writer.pyx.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/_websocket.pyx.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash copying aiohttp/.hash/hdrs.py.hash -> build/lib.macosx-10.9-universal2-cpython-312/aiohttp/.hash running build_ext building 'aiohttp._websocket' extension creating build/temp.macosx-10.9-universal2-cpython-312 creating build/temp.macosx-10.9-universal2-cpython-312/aiohttp clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -arch arm64 -arch x86_64 -g -I/private/var/folders/lr/1x8b2s650xq4ng5bv209ypy40000gn/T/tmpux8kwxlb/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c aiohttp/_websocket.c -o build/temp.macosx-10.9-universal2-cpython-312/aiohttp/_websocket.o aiohttp/_websocket.c:1475:17: warning: 'Py_OptimizeFlag' is deprecated [-Wdeprecated-declarations] if (unlikely(!Py_OptimizeFlag)) { ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/pydebug.h:13:1: note: 'Py_OptimizeFlag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_OptimizeFlag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:2680:27: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] return likely(dict) ? PYX_GET_DICT_VERSION(dict) : 0; ^ aiohttp/_websocket.c:1118:65: note: expanded from macro 'PYX_GET_DICT_VERSION'
define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:2692:36: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] return (dictptr && dictptr) ? __PYX_GET_DICT_VERSION(dictptr) : 0; ^ aiohttp/_websocket.c:1118:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:2696:56: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] if (unlikely(!dict) || unlikely(tp_dict_version != PYX_GET_DICT_VERSION(dict))) ^ aiohttp/_websocket.c:1118:65: note: expanded from macro 'PYX_GET_DICT_VERSION'
define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:2741:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] PYX_PY_DICT_LOOKUP_IF_MODIFIED( ^ aiohttp/_websocket.c:1125:16: note: expanded from macro 'PYX_PY_DICT_LOOKUP_IF_MODIFIED' if (likely(PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ ^ aiohttp/_websocket.c:1118:65: note: expanded from macro 'PYX_GET_DICT_VERSION'
define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:2741:9: warning: 'ma_version_tag' is deprecated [-Wdeprecated-declarations] PYX_PY_DICT_LOOKUP_IF_MODIFIED( ^ aiohttp/_websocket.c:1129:30: note: expanded from macro 'PYX_PY_DICT_LOOKUP_IF_MODIFIED' pyx_dict_version = PYX_GET_DICT_VERSION(DICT);\ ^ aiohttp/_websocket.c:1118:65: note: expanded from macro '__PYX_GET_DICT_VERSION'
define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
/Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/cpython/dictobject.h:22:5: note: 'ma_version_tag' has been explicitly marked deprecated here Py_DEPRECATED(3.12) uint64_t ma_version_tag; ^ /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12/pyport.h:317:54: note: expanded from macro 'Py_DEPRECATED'
define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated))
aiohttp/_websocket.c:3042:55: error: no member named 'ob_digit' in 'struct _longobject' const digit digits = ((PyLongObject)x)->ob_digit;
Setup completed successfully. Benchmark Server starting please wait... Agent 'MyGPT' starting please wait... user@MacBook-Pro AutoGPT % kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] Please add your api keys to the .env file. Command not found: agbenchmark Traceback (most recent call last): File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/Users/user/Desktop/MyGPT/autogpts/MyGPT/forge/main.py", line 3, in
import uvicorn
ModuleNotFoundError: No module named 'uvicorn'
`
I had manually installed the 'uvicorn' but the error continue to rising. Please, help me to solve it.
Upload Activity Log Content
No response
Upload Error Log Content
No response