Creating a Dependency
You are advised to create function dependencies in Huawei Cloud EulerOS 2.0. If other OSs are used, an error may occur due to underlying dependent libraries. For example, the dynamic link library cannot be found.
- If the modules to be installed need dependencies such as .dll, .so, and .a, archive them to a .zip package.
Creating a Dependency for a Python Function
Ensure that the Python version of the packaging environment is the same as that of the function. For Python 2.7, Python 2.7.12 or later is recommended. For Python 3.6, Python 3.6.3 or later is recommended.
To install the PyMySQL dependency for a Python 2.7 function in the local /tmp/pymysql directory, run the following command:
pip install PyMySQL --root /tmp/pymysql
After the command is successfully executed, go to the /tmp/pymysql directory:
cd /tmp/pymysql/
Go to the site-packages directory (generally, usr/lib64/python2.7/site-packages/) and then run the following command:
zip -rq pymysql.zip *
The required dependency is generated.
To install the local wheel installation package, run the following command:
pip install piexif-1.1.0b0-py2.py3-none-any.whl --root /tmp/piexif //Replace piexif-1.1.0b0-py2.py3-none-any.whl with the actual installation package name.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot