当我尝试在AWS Lambda上部署无服务器应用程序时,遇到以下错误:
STDERR: ERROR: aws-sam-cli 0.46.2 has requirement jmespath~=0.9.5, but you'll have jmespath 0.9.4 which is incompatible.
ERROR: Exception:
Traceback (most recent call last):
File "/var/lang/lib/python3.6/shutil.py", line 550, in move
os.rename(src, real_dst)
OSError: [Errno 18] Invalid cross-device link: '/tmp/pip-target-ykxrpsrj/lib/python/gast-0.3.3.dist-info' -> '/var/task/gast-0.3.3.dist-info'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/lang/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/var/lang/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 454, in run
options.target_dir, target_temp_dir, options.upgrade
File "/var/lang/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 512, in _handle_target_dir
target_item_dir
File "/var/lang/lib/python3.6/shutil.py", line 561, in move
symlinks=True)
File "/var/lang/lib/python3.6/shutil.py", line 321, in copytree
os.makedirs(dst)
File "/var/lang/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/var/task/gast-0.3.3.dist-info'
WARNING: You are using pip version 20.0.2; however, version 20.2.3 is available.
You should consider upgrading via the '/var/lang/bin/python3.6 -m pip install --upgrade pip' command.我正在使用一个从头开始创建的新Anaconda环境,我的应用程序中的需求文件写道:
jmespath==0.9.5在部署之前,我使用以下命令安装插件(例如tensorflow):
serverless plugin install -n serverless-python-requirementsDocker正在正常运行,并且我的serverless.yml文件包含以下内容:
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: true
zip: true
slim: true
noDeploy:
- boto3
- botocore
- docutils
- jmespath
- pip
- python-dateutil
- s3transfer
- setuptools
- six
- tensorboard我该如何解决这个问题?
发布于 2020-11-27 08:44:52
正如在另一个SO question中指出的,这可能是由于experimental Docker feature called Use gRPC FUSE for file sharing,我现在关闭了它。部署之后似乎是可以的。
https://stackoverflow.com/questions/63933684
复制相似问题