I created a layer and it did work.

0

Here is the context of my zip file.
I installed a python package with "python setup.py install --prefix=." command.
And this package doesn't exist on pypi so I have to install this way.

zip -sf test.zip  
Archive contains:  
  python/  
  python/openapi_client.egg-info/  
  python/openapi_client.egg-info/top_level.txt  
  python/openapi_client.egg-info/dependency_links.txt  
  python/openapi_client.egg-info/requires.txt  
  python/openapi_client.egg-info/PKG-INFO  
  python/openapi_client.egg-info/SOURCES.txt  
  python/dist/  
  python/dist/openapi_client-1.0.0-py3.8.egg  
  python/lib/  
  python/lib/python3.8/  
  python/lib/python3.8/site-packages/  
  python/lib/python3.8/site-packages/openapi_client-1.0.0-py3.8.egg  
  python/build/  
  python/build/bdist.linux-x86_64/  
質問済み 2年前284ビュー
1回答
0

Have you tried doing zip -r test.zip - that works for the layers I have here.

profile pictureAWS
エキスパート
回答済み 2年前
  • Yeah, I used this command to build test.zip file. I used the same procedure to build another layer which contains some packages piped from pypi and it worked. So I'm pretty sure the procedure is correct. But I don't know why this layer doesn't work.

  • I'd suggest creating smaller, less complex layers. If they work then gradually work your way up to things that are more complex (such as your example) to see where things are breaking. Are you building the layer on an Amazon Linux EC2 instance?

  • Yes, I built it on a EC2 instance. This layer only contains one package. I wonder if it's because the file in this package is egg file not .py file so that it can't be recognized?

  • Here is the runtime error message: ''' { "errorMessage": "Unable to import module 'lambda_function': No module named 'openapi_client'", "errorType": "Runtime.ImportModuleError", "stackTrace": [] } '''

  • I've only ever tried building layers with .py files so that's definitely a place to check.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ