Back

Import error: appwrite.enums

  • 1
  • Databases
  • Cloud
Valou
26 Nov, 2024, 22:33

Hey Appwrite, I am trying to follow along with your documentation to create a relationship attribute in a collection in from python (https://appwrite.io/docs/references/cloud/server-python/databases#createRelationshipAttribute) However when running this as a function on your cloud instance and locally on my own machine i keep getting this error:

ImportError: cannot import name 'RelationshipType' from 'appwrite.enums' (/usr/local/server/src/function/runtime-env/lib/python3.9/site-packages/appwrite/enums/__init__.py) Even though i am importing the package just as in the documentation:

from appwrite.enums import RelationshipType

Second question: where can i import the RelationMutate package from?

Thanks for all your amazing work at appwrite, really appreciate it!

TL;DR
Issue: Import error for appwrite.enums package in Python. Solution: - Make sure the `RelationshipType` is imported correctly using `from appwrite.enums import RelationshipType`. - For importing the `RelationMutate` package, you can access it within the `appwrite` library directly. Overall: Developers are facing an import error with `appwrite.enums` in Python when trying to create a relationship attribute. The correct import statement for `RelationshipType` should resolve the issue. For `RelationMutate`, it can be accessed directly within the `appwrite` library.
Valou
26 Nov, 2024, 22:34

Import error: appwrite.enums

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more