1Password / onepassword-sdk-python

https://developer.1password.com/docs/sdks/
MIT License
85 stars 9 forks source link

keep getting modulenotfounderror for onepassword #79

Closed simkimsia closed 3 months ago

simkimsia commented 3 months ago

Scenario & Reproduction Steps

import asyncio
import os
from onepassword.client import Client

async def main():
    # Gets your service account token from the OP_SERVICE_ACCOUNT_TOKEN environment variable.
    token = os.getenv("OP_SERVICE_ACCOUNT_TOKEN")

    # Connects to 1Password. Fill in your own integration name and version.
    client = await Client.authenticate(auth=token, integration_name="My 1Password Integration", integration_version="v1.0.0")

    # Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
    value = await client.secrets.resolve("op://vault/item/field")
    # use value here

if __name__ == '__main__':
    asyncio.run(main())

i am using this in step 4 of readme.md

and i keep getting

 File "/Users/kimsia/Projects/windmill_dev/00_first_try/onepassword.py", line 3, in <module>
    from onepassword.client import Client
  File "/Users/kimsia/Projects/windmill_dev/00_first_try/onepassword.py", line 3, in <module>
    from onepassword.client import Client
ModuleNotFoundError: No module named 'onepassword.client'; 'onepassword' is not a package

i used

pip install git+ssh://git@github.com/1Password/onepassword-sdk-python.git@v0.1.0-beta.11

Actual Behavior

 File "/Users/kimsia/Projects/windmill_dev/00_first_try/onepassword.py", line 3, in <module>
    from onepassword.client import Client
  File "/Users/kimsia/Projects/windmill_dev/00_first_try/onepassword.py", line 3, in <module>
    from onepassword.client import Client
ModuleNotFoundError: No module named 'onepassword.client'; 'onepassword' is not a package

Expected Behavior

that it works?

SDK version

pip install git+ssh://git@github.com/1Password/onepassword-sdk-python.git@v0.1.0-beta.11

Additional information

No response

Marton6 commented 3 months ago

Hi @simkimsia! Thanks for reporting this bug. We will look into fixing it soon, in the next release of the SDKs

AndyTitu commented 3 months ago

@Marton6 were you able to reproduce? For me this works fine.

@simkimsia What happens when you try python3 -m pip list. Does onepassword show up?

simkimsia commented 3 months ago

sorry i know why.