Вот моя функция:
Код: Выделить всё
from appwrite.client import Client
from appwrite.services.storage import Storage
import pandas as pd
def main(req, res):
file_id = res.payload["fileId"]
bucket_id = res.variables.BUCKET_ID
api_key = res.variables.API_KEY
client = Client().set_endpoint(res.variables.ENDPOINT).set_project(res.variables.PROJECT_ID).set_key(api_key)
storage = Storage(client)
binary_csv = storage.get_file_view(bucket_id, file_id)
data = BytesIO(binary_csv) # type: ignore
df = pd.read_csv(data)
value = df.to_json(orient="records")
return res.json({
"message": "Success ",
"payload": value
})
Код: Выделить всё
appwrite
numpy>=1.23.0
pandas>=1.5.0
Код: Выделить всё
Docker Error: error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code:
╰─> [ lines of output]
Collecting setuptools>=.0
Downloading setuptools-65.5.0-py3-none-any.whl ( MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ /1.2 MB MB/s eta :00:00
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl ( kB)
Collecting Cython=.32
Using cached Cython-0.29.32-cp310-cp310-musllinux_1_1_x86_64.whl ( MB)
Collecting oldest-supported-numpy>=
Downloading oldest_supported_numpy-2022.8.16-py3-none-any.whl ( kB)
Collecting numpy==.6
Downloading numpy-1.21.6.zip ( MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ /10.3 MB MB/s eta :00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml): started
Building wheel for numpy (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Код: Выделить всё
Collecting appwrite
Downloading appwrite-1.1.0.tar.gz (13 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting numpy>=1.23.0
Downloading numpy-1.23.4.tar.gz (10.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.7/10.7 MB 18.8 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting pandas>=1.5.0
Downloading pandas-1.5.1.tar.gz (5.2 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.2/5.2 MB 115.3 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
Подробнее здесь: https://stackoverflow.com/questions/741 ... ically-def