crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Running CrewAI on a web app with Pyodide

Open microchipgnu opened this issue 2 years ago • 1 comments

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

  1. Set up a Pyodide environment in an HTML file.
  2. Attempt to install crewai using micropip.install.
  3. 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.

microchipgnu avatar Jan 02 '24 16:01 microchipgnu

Hi @microchipgnu - it looks like this topic may be explored in this pydantic-core issue.

greysonlalonde avatar Jan 02 '24 18:01 greysonlalonde

@microchipgnu lmk if you found workarounds given that thread meanwhile I'm closing this one

joaomdmoura avatar Jan 21 '24 03:01 joaomdmoura