"Import Error lxml" is shown in AWS Lambda - python-3.x

I am trying to run using pygal libray to show graph in AWS lambda.But this error is shown, even I have already installed lxml.deployment_package
my_source_code
import_error

It's because lxml contains binary pre-compiled libraries that it uses. When you install lxml locally on your Windows machine, you install a Windows-compatible version of it. However this is not compatible with the Lambda execution environment which is Linux based.
So you have to create a Lambda compatible deployment package. You have couple of options doing so. You can use sam build --use-container, you can build the libraries in a Docker environment and then zip those, etc. See this answer as well.

Related

Deploying Node.js app with gdal | AWS Elastic Beanstalk

I'm trying to deploy a node.js app but get stuck with an error about missing dependencies for gdal.
Error: /lib64/libm.so.6: version 'GLIBC_2.27' not found (required by /var/app/current/node_modules/gdal/lib/binding/gdal.node)
How would I go about installing this required dependency?
gdal-async on npm explicitly supports AWS.
As its author, I will be happy to help you if it doesn't work - you can create an issue on github.
I don't know what you call gdal.js.
There is the original gdal by Mapbox and Natural Atlas that is not actively developed anymore.
There is gdal-next on which I used to work a little bit which has a current version of GDAL but it is not very active either.
There is my gdal-async which is the only one that is currently active.
And there is an Emscripten port that is pure JS and runs in the browser, but it is stalled at GDAL 2.
Supporting AWS is simply a matter of compiling with the right libraries.

Python3.5 to python3.7 upgrade in the build

Idea is to build the distroless docker image and available python3 google distorless image version is 3.7 - gcr.io/distroless/python3. Our code is already compiled and running with python3.5 version and required to upgrade the version into 3.7 so that we can get rid of the library, compactability issues and can make use of the distroless image with verison 3.7. Some questions are,
Will version upgrade cause any issues to the existing code compilation?
Do we need to change all the requirements.txt versions according to the 3.7?
If yes, will there is an impact of the application?
the Python language does not provide backward compatibility. My recommendation for you is to run your code on a virtual env with the new version of Python and test your code. If you do not want to use virtual env you could create a new docker image with the Python version and test your app. Regarding the requirements.txt, without seeing the libraries or packages there, it is impossible to say if you should change the file.

How can I know which Debian libraries Electron needs to run?

What I'm doing
I'm building an Electron-based kiosk app using Balena to run on a Raspberry Pi 4. Balena requires a Dockerfile to build the container that will run my app. In that Dockerfile, I must make sure I install all the libraries needed by Electron. The image I'm using is based on Debian Buster (the default image Balena uses).
What I know
I've found two working examples in GitHub similar to what I'm trying to do where I can see which libraries are installed:
https://github.com/Ciantic/balena-electron-example (list of installed libraries)
https://github.com/balena-io/balena-electronjs (list of installed libraries)
And also two files inside the Electron repo that mention required libraries:
https://github.com/electron/electron/blob/77049545050673949b2844f17b3731196947956a/build/install-build-deps.sh#L189-L231
https://github.com/electron/electron/blob/d5ab63b1ead93dcb4e3099fccd4670fe9258ca9c/docs/development/build-instructions-linux.md
What's confusing me
Each list of libraries in the above files is different from the others. I don't know which one I should follow. Also, the build instructions for Linux don't have any list specific for Debian.
My question
How can I know for sure exactly which libraries I need to install in my Debian-based container so that Electron can run?
In the example, it should show a Dockerfile that you can use to get the required libraries.

Not able to install the RYU controller

I have tried to install the RYU controller .
I am using the below commands “sudo python setup.py install “ its error out with below message
That ryu.hooks not available and when I run the command “python setup.py install” it gives the error that setuptools not available .
Please give the response as soon as possible we are in the middle of installing the controller .
-Ajay
Are you installing the controller in a Linux-based VM? If so, then SDN Hub (http://sdnhub.org/resources/) offers a vm with Ryu already installed. You may consider downloading and using it. Depending on your familiarity with Ryu, you may also want to use the Ryuretic framework for implementing your project. The linked lab provides instructions for getting it up and running.

Is is possible to install sharp for node.js without python?

I am needing to install sharp for node.js https://github.com/lovell/sharp but it appears that one of its dependencies (libvips) needs python (and so installation fails as I don't have python on my system and don't expect I'll be able to use python in my production environment).
I read that on the sharp github page it states "OS X, Windows (x64), Linux (x64, ARM) systems do not require the installation of any external runtime dependencies." so I'm not sure why I need python.
The sharp package uses node-gyp, which is a tool for "compiling native addon modules for Node.js." Typically native means C or C++ libraries like libvips. Python 2.7 is required for node-gyp to work as explained in the install docs. Despite sharp coming with prebuilt binaries, it still requires node-gyp (for now) as explained in this issue.
Using version 0.26.x of sharp seems to fix the issue now and doesn't require Python to install.
From their changelogs:
Prebuilt libvips binaries are now statically-linked and
Brotli-compressed, requiring Node.js 10.16.0+.

Resources