M
M
Mikhail Ponchikov2020-03-09 14:50:58
Python
Mikhail Ponchikov, 2020-03-09 14:50:58

How to place lxml on yandex cloud functions?

It is necessary to write a function that, when a file enters the S3 storage, would parse it. The difficulty lies in the fact that all dependencies must be located directly in the folder with the script itself and there is no way to use the Virtual Environment. And here the difficulty arose with the fact that I can’t get Beautiful Soup to see the parser in any way:

errorMessage": "Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?",

Maybe someone faced the problem of local import of the lxml library. Please tell me how I can try to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Ponchikov, 2020-03-15
@vaims_in_arms

The answer is found, it is necessary to build all the necessary modules in a virtual env (directly using linux for this).
There was also a need to use a connection to Postgesql via Psycopg 2. On Linux, there are serious difficulties with installing it in a virtual-env, so you need to use pip install psycopg2-binary instead of pip install psycopg2.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question