Running CrewAI on a web app with Pyodide
Issue with Dependencies when Installing crewai with Pyodide
Description
I'm encountering an issue when trying to install the crewai package using Pyodide in a web environment. It appears that Pyodide is unable to find compatible Python wheels for several dependencies required by crewai.
Steps to Reproduce
- Set up a Pyodide environment in an HTML file.
- Attempt to install
crewaiusingmicropip.install. - Encounter errors indicating missing Python wheels for specific dependencies.
Expected Behavior
I expected crewai to install successfully along with its dependencies.
Actual Behavior
The installation process failed with the following error messages, indicating missing Python wheels for these dependencies:
- pydantic-core==2.14.6
- aiohttp<4.0.0,>=3.8.3
- langchain-core<0.2,>=0.1
These dependencies seem to be related to langchain, which crewai relies on.
Potential Causes
It's likely that these dependencies either:
- Do not have pure Python wheels available that are compatible with Pyodide.
- Require specific versions that are not yet supported in the Pyodide environment.
Code
<!doctype html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js"></script>
</head>
<body>
<script type="text/javascript">
async function main(){
let pyodide = await loadPyodide();
await pyodide.loadPackage("micropip");
const micropip = pyodide.pyimport("micropip");
await micropip.install("crewai", keep_going="True");
}
main();
</script>
</body>
</html>
Suggested Solutions or Workarounds
I am looking for guidance on whether there are any known workarounds or if there are alternative versions of these dependencies that are compatible with Pyodide.
Hi @microchipgnu - it looks like this topic may be explored in this pydantic-core issue.
@microchipgnu lmk if you found workarounds given that thread meanwhile I'm closing this one