Skip to content
Back

function not working

  • 0
  • Functions
mitsy0_0
20 Nov, 2023, 04:12

I created an appwrite function from cli

on executing python function:

TypeScript
  File "/usr/local/server/src/server.py", line 165, in handler
    output = await asyncio.wait_for(execute(context), timeout=safeTimeout)
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 479, in wait_for
    return fut.result()
  File "/usr/local/server/src/server.py", line 150, in execute
    userModule = importlib.import_module("function." + userPath)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/server/src/function/src/index.py", line 1, in <module>
    from appwrite.client import Client
ModuleNotFoundError: No module named 'appwrite'```

I ran the template code only, it has `appwrite` in requirements.txt
TL;DR
User is experiencing an issue with a function not working. They are getting an error message "ModuleNotFoundError: No module named 'appwrite'" when trying to execute a Python function. They have upgraded their appwrite-cli to version 4.2.0 and the appwrite instance is at version 13.0.0. The user is asking for help. Solution: The user needs to ensure that the 'appwrite' module is installed. They can do this by running `pip install appwrite` or adding it to their requirements.txt file and running `pip install -r requirements.txt`.
mitsy0_0
20 Nov, 2023, 19:15

guys help please😭

Drake
20 Nov, 2023, 19:22

what version of the CLI do you have? and what version of Appwrite?

mitsy0_0
20 Nov, 2023, 19:40

appwrite -v gives: 1.2.1

Drake
20 Nov, 2023, 19:46

And your version of Appwrite?

mitsy0_0
20 Nov, 2023, 19:49

"appwrite": "^13.0.0"

Drake
20 Nov, 2023, 19:49

No, not your Appwrite SDK. The appwrite instance version

mitsy0_0
20 Nov, 2023, 19:51

Oh you mean this- Version 1.4.13

Drake
20 Nov, 2023, 19:52

Your CLI is old compared to your appwrite version. maybe you can delete your function, upgrade your CLI and then initialize again

mitsy0_0
20 Nov, 2023, 19:55

whats the command to upgrade cli? i couldnt find in docs;-; Do i just- yarn global add appwrite-cli@latest?

Drake
20 Nov, 2023, 19:56

Yes if you installed via yarn before

mitsy0_0
21 Nov, 2023, 05:44

now I have 4.2.0

mitsy0_0
21 Nov, 2023, 05:44

im getting Incorrect string value: '\xE2' for column 'logs' at row 1

mitsy0_0
21 Nov, 2023, 05:44

on deploying

Drake
21 Nov, 2023, 20:41

what's your new code and what are the settings for your function?

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