我正面临 AWS lambda 函数的问题。我无法将 pygit2 库导入我的函数。我在 4 个不同的运行时环境中进行了尝试,每个环境都给出了不同的错误,这让我认为库中存在问题而不是我的代码。这些是我得到的错误: github_pull_source 是我的函数的名称。
Python 2.7 - Unable to import module 'github_pull_source': No module named _pygit2
Python 3.6 - Unable to import module 'github_pull_source': /var/task/_cffi_backend.so: undefined symbol: _Py_ZeroStruct
Python 3.7 - Unable to import module 'github_pull_source': No module named 'pygit2._pygit2'
Python 3.8 - Unable to import module 'github_pull_source': No module named 'pygit2._pygit2'
我像这样导入库:
from pygit2 import Keypair, discover_repository, Repository, clone_repository, RemoteCallbacks
部署包的结构
deployment_package.zip
- source_code.py
- __init__.py
- pygit2
- libgit2-f9f42b17.so.1.0.0
- libgit2.tar.gz
- libgit2.so.26
- _pygit2.so
- and some other libraries like requests etc
有没有人经历过类似的事情?
谢谢