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

issue - cannot import name 'Action' from 'composio' #1115

Open
Madhuvod opened this issue Dec 31, 2024 · 14 comments
Open

issue - cannot import name 'Action' from 'composio' #1115

Madhuvod opened this issue Dec 31, 2024 · 14 comments

Comments

@Madhuvod
Copy link

I constantly get this error: I want to use the google docs tool or notion tool where my phidata agent writes its response by creating a new doc and writing in it. but I have been constantly facing this error. my python version is 3.12.7, any solutions pls? also the composio docs to use notion tool is very confusing, any simple workflow examples can help. thanks. the error:

(base) madhushantan@Madhus-MacBook-Air ai_personal_learning_agent % composio add googledocs
Traceback (most recent call last):
  File "/Users/madhushantan/.pyenv/versions/3.12.7/bin/composio", line 5, in <module>
    from composio.cli import cli
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/__init__.py", line 10, in
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/__init__.py", line 10, in <module>
    from composio.cli.actions import _actions
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/actions.py", line 13, in 
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/actions.py", line 13, in <module>
    from composio.cli.context import Context, pass_context
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/context.py", line 23, in 
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/context.py", line 23, in <module>
    from composio.tools.env.factory import WorkspaceType
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/__init__.py", line 1, i
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/__init__.py", line 1, in <module>
    from .toolset import ComposioToolSet
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/toolset.py", line 23, i
  File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/toolset.py", line 23, in <module>
    from composio import Action, ActionType, App, AppType, TagType
ImportError: cannot import name 'Action' from 'composio' (/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/si
ImportError: cannot import name 'Action' from 'composio' (/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/__init__.py)
@plxity
Copy link
Contributor

plxity commented Jan 1, 2025

@Madhuvod Thanks for reporting this, I'll check and update you.

@Madhuvod
Copy link
Author

Madhuvod commented Jan 1, 2025

yes, thanks! pls lmk as soon as possible - working on a project and wanting to use Composio tools for it

@tushar-composio
Copy link
Collaborator

Hey, can you run the following commands and send us their output?

which composio
which pip
pip show composio
composio --version

@Madhuvod
Copy link
Author

Madhuvod commented Jan 2, 2025

(base) madhushantan@Madhus-MacBook-Air ai_agent_tutorials % which composio
/Users/madhushantan/.pyenv/versions/3.12.7/bin/composio
(base) madhushantan@Madhus-MacBook-Air ai_agent_tutorials % which pip
/Users/madhushantan/.pyenv/versions/3.12.7/bin/pip
(base) madhushantan@Madhus-MacBook-Air ai_agent_tutorials % pip show composio
Name: composio
Version: 0.1.0
Summary: Composio Python SDK.
Home-page: https://github.com/tushar-composio/composio
Author: Tushar Sadhwani
Author-email: [email protected]
License: MIT
Location: /Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages
Requires:
Required-by:
(base) madhushantan@Madhus-MacBook-Air ai_agent_tutorials % composio --version
Traceback (most recent call last):
File "/Users/madhushantan/.pyenv/versions/3.12.7/bin/composio", line 5, in
from composio.cli import cli
File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/init.py", line 10, in
from composio.cli.actions import _actions
File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/actions.py", line 13, in
from composio.cli.context import Context, pass_context
File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/cli/context.py", line 23, in
from composio.tools.env.factory import WorkspaceType
File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/init.py", line 1, in
from .toolset import ComposioToolSet
File "/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/tools/toolset.py", line 23, in
from composio import Action, ActionType, App, AppType, TagType
ImportError: cannot import name 'Action' from 'composio' (/Users/madhushantan/.pyenv/versions/3.12.7/lib/python3.12/site-packages/composio/init.py)

@Madhuvod
Copy link
Author

Madhuvod commented Jan 4, 2025

@tushar-composio can you solve this please

@tusharsadhwani
Copy link

Please do the following:

pip uninstall composio -y
pip install composio-core

@plxity
Copy link
Contributor

plxity commented Jan 7, 2025

@Madhuvod I'm Just following up. Did it work after running the above commands?

@SakshiiKorat
Copy link

it's not working

@tusharsadhwani
Copy link

@SakshiiKorat can you paste the output of the following commands?

which composio
which pip
pip show composio
pip show composio-core
composio --version

@SakshiiKorat
Copy link

(venv) PS D:\task\composio> where python
(venv) PS D:\task\composio>

(venv) PS D:\task\composio> pip show composio
Name: composio
Version: 0.1.1
Summary: Shim for composio-core.
Home-page: https://github.com/tushar-composio/composio
Author: Tushar Sadhwani
Author-email: [email protected]
License: MIT
Location: D:\task\composio\venv\Lib\site-packages
Requires: composio-core
Required-by:

(venv) PS D:\task\composio> pip show composio-core
Name: composio_core
Version: 0.6.11.post1
Summary: Core package to act as a bridge between composio platform and other services.
Home-page: https://github.com/composiohq/composio
Author: Utkarsh
Author-email: [email protected]
License:
Location: D:\task\composio\venv\Lib\site-packages
Requires: aiohttp, click, fastapi, importlib-metadata, inflection, jsonref, jsonschema, paramiko, pydantic, pyperclip, pysher, requests, rich, semver, sentry-sdk, uvicorn
Required-by: composio, composio_langchain

(venv) PS D:\task\composio> composio --version
composio : The term 'composio' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
At line:1 char:1

  • composio --version
  •   + CategoryInfo          : ObjectNotFound: (composio:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

@SakshiiKorat
Copy link

(venv) PS D:\task\composio> Get-Command pip

CommandType Name Version Source


Application pip.exe 0.0.0.0 D:\task\composio\venv\scripts\pip.exe

@SakshiiKorat
Copy link

SakshiiKorat commented Jan 8, 2025 via email

@Madhuvod
Copy link
Author

Madhuvod commented Jan 8, 2025

@plxity @tusharsadhwani it is indeed working for me. but I have a doubt tho. for me to use a particular composio tool - lets say google docs's - Create new document action, do I need to do anything else apart from these two step:

composio add googledocs

select OAUTH2 → SELECT GOOGLE ACCOUNT

and I get final output as:

⚠ Waiting for googledocs authentication...
✔ googledocs added successfully with ID: 227fdfe1-2fe9-4f42-a674b89

for the 2nd step:

TO https://app.composio.dev/app/googledocs AND click create integration and click Try connecting default’s googldocs button and done.

Apart from this and using the composio api key in our code, anything else needs to be done?

@SakshiiKorat
Copy link

SakshiiKorat commented Jan 9, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants