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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인