Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django应用程序无法在AWS ElasticBeanstalk上部署';firebase管理员';图书馆_Python_Django_Firebase_Amazon Elastic Beanstalk_Firebase Admin - Fatal编程技术网

Python Django应用程序无法在AWS ElasticBeanstalk上部署';firebase管理员';图书馆

Python Django应用程序无法在AWS ElasticBeanstalk上部署';firebase管理员';图书馆,python,django,firebase,amazon-elastic-beanstalk,firebase-admin,Python,Django,Firebase,Amazon Elastic Beanstalk,Firebase Admin,我正在将python/django应用程序部署到aws elasticbeanstalk。 如果我没有在requirements.txt中指定'firebase admin'库,它就可以很好地部署。 但如果我在requirements.txt中添加“firebase admin”,无论是什么版本,都无法部署,如下所示: 以下是我的requirements.txt: Django==3.0.1 djangorestframework==3.11.0 psycopg2==2.7.3.1 djang

我正在将python/django应用程序部署到aws elasticbeanstalk。 如果我没有在requirements.txt中指定'firebase admin'库,它就可以很好地部署。 但如果我在requirements.txt中添加“firebase admin”,无论是什么版本,都无法部署,如下所示:

以下是我的requirements.txt:

Django==3.0.1
djangorestframework==3.11.0
psycopg2==2.7.3.1
django-cors-headers==3.2.0
pytz==2017.2
tinys3==0.1.12
apiclient==1.0.3
drf_yasg==1.17.1
google-api-python-client==1.7.3
google-auth==1.5.0
google-auth-httplib2==0.0.3
httplib2==0.11.3
django-rest-auth==0.9.5
oauth2client==4.1.2
geographiclib==1.50
geopy==1.20.0
numpy==1.15.2
pyyaml==5.3.1
和AWS elasticbeanstalk python实例详细信息: 在64位Amazon Linux/2.9.7上运行的Python 3.6

请帮忙。谢谢

更新: 以下requirements.txt适用于localhost虚拟环境:

Django==3.0.1
djangorestframework==3.11.0
psycopg2==2.7.3.1
django-cors-headers==3.2.0
pytz==2017.2
tinys3==0.1.12
apiclient==1.0.3
drf_yasg==1.17.1
google-api-python-client==1.7.8
google-auth==1.14.0
google-auth-httplib2==0.0.3
httplib2==0.11.3
django-rest-auth==0.9.5
oauth2client==4.1.2
geopy==1.20.0
pyyaml==5.3.1
firebase-admin==2.13.0
但在部署到AWS时会出现以下错误:

ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2020-04-22 00:14:47    ERROR   [Instance: i-0864d69c58c343870] Command failed on instance. Return code: 1 Output: (TRUNCATED)...)
  File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. 
完成AWS日志:

-------------------------------------
/var/log/eb-activity.log
-------------------------------------
          pp_opts)
        File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 129, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command 'gcc' failed with exit status 1

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-build-h4kd5_1k/grpcio/setup.py", line 400, in <module>
          cmdclass=COMMAND_CLASS,
        File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
          dist.run_commands()
        File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
          self.run_command(cmd)
        File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
          return orig.install.run(self)
        File "/usr/lib64/python3.6/distutils/command/install.py", line 593, in run
          self.run_command('build')
        File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
          cmd_obj.run()
        File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 87, in run
          _build_ext.run(self)
        File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in run
          self.build_extensions()
        File "/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py", line 267, in build_extensions
          "Failed `build_ext` step:\n{}".format(formatted_exception))
      commands.CommandError: Failed `build_ext` step:
      Traceback (most recent call last):
        File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 127, in _compile
          extra_postargs)
        File "/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/_spawn_patch.py", line 54, in _commandfile_spawn
          _classic_spawn(self, command)
        File "/usr/lib64/python3.6/distutils/ccompiler.py", line 909, in spawn
          spawn(cmd, dry_run=self.dry_run)
        File "/usr/lib64/python3.6/distutils/spawn.py", line 36, in spawn
          _spawn_posix(cmd, search_path, dry_run=dry_run)
        File "/usr/lib64/python3.6/distutils/spawn.py", line 159, in _spawn_posix
          % (cmd, exit_status))
      distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 1

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py", line 262, in build_extensions
          build_ext.build_ext.build_extensions(self)
        File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
          self._build_extensions_serial()
        File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
          self.build_extension(ext)
        File "/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 208, in build_extension
          _build_ext.build_extension(self, ext)
        File "/usr/lib64/python3.6/distutils/command/build_ext.py", line 533, in build_extension
          depends=ext.depends)
        File "/usr/lib64/python3.6/distutils/ccompiler.py", line 574, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py", line 246, in new_compile
          pp_opts)
        File "/usr/lib64/python3.6/distutils/unixccompiler.py", line 129, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command 'gcc' failed with exit status 1


      ----------------------------------------
  Command "/opt/python/run/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h4kd5_1k/grpcio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-okr6a_v3-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python3.6/grpcio" failed with error code 1 in /tmp/pip-build-h4kd5_1k/grpcio/
  You are using pip version 9.0.1, however version 20.0.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2020-04-22 23:07:23,479 ERROR    Error installing dependencies: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1
  Traceback (most recent call last):
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 22, in main
      install_dependencies()
    File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 18, in install_dependencies
      check_call('%s install -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
    File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
      raise CalledProcessError(retcode, cmd)
  CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/onde

ck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
-------------------------------------
/var/log/eb-activity.log
-------------------------------------
pp_选项)
文件“/usr/lib64/python3.6/distutils/unixcompiler.py”,第129行,在编译中
提高编译器错误(msg)
distutils.errors.CompileError:命令“gcc”失败,退出状态为1
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/tmp/pip-build-h4kd5_1k/grpcio/setup.py”,第400行,in
cmdclass=命令类,
文件“/opt/python/run/venv/local/lib/python3.6/site packages/setuptools/_init__.py”,第144行,在安装程序中
返回distutils.core.setup(**attrs)
文件“/usr/lib64/python3.6/distutils/core.py”,第148行,在安装程序中
dist.run_命令()
文件“/usr/lib64/python3.6/distutils/dist.py”,第955行,在run_命令中
self.run_命令(cmd)
文件“/usr/lib64/python3.6/distutils/dist.py”,第974行,在run_命令中
cmd_obj.run()
文件“/opt/python/run/venv/local/lib/python3.6/site-packages/setuptools/command/install.py”,第61行,运行中
返回原始安装运行(自身)
文件“/usr/lib64/python3.6/distutils/command/install.py”,第593行,正在运行
self.run_命令('build'))
文件“/usr/lib64/python3.6/distutils/cmd.py”,第313行,在run_命令中
self.distribution.run_命令(command)
文件“/usr/lib64/python3.6/distutils/dist.py”,第974行,在run_命令中
cmd_obj.run()
文件“/usr/lib64/python3.6/distutils/command/build.py”,第135行,正在运行
self.run_命令(cmd_名称)
文件“/usr/lib64/python3.6/distutils/cmd.py”,第313行,在run_命令中
self.distribution.run_命令(command)
文件“/usr/lib64/python3.6/distutils/dist.py”,第974行,在run_命令中
cmd_obj.run()
文件“/opt/python/run/venv/local/lib/python3.6/site packages/setuptools/command/build_ext.py”,第87行,运行中
_构建外部运行(自身)
文件“/usr/lib64/python3.6/distutils/command/build_ext.py”,第339行,正在运行
self.build_扩展()
文件“/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py”,第267行,内部版本扩展名
“失败的`build_ext`步骤:\n{}”。格式(格式化的\u异常))
commands.CommandError:失败的“生成外部”步骤:
回溯(最近一次呼叫最后一次):
文件“/usr/lib64/python3.6/distutils/unixcompiler.py”,第127行,在编译中
额外费用(邮资)
文件“/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/_spawn_patch.py”,第54行,在命令文件中
_经典产卵(自我,命令)
文件“/usr/lib64/python3.6/distutils/ccompiler.py”,第909行,在spawn中
繁殖(cmd,dry\u run=self.dry\u run)
文件“/usr/lib64/python3.6/distutils/spawn.py”,第36行,在spawn中
_生成posix(命令,搜索路径,干运行=干运行)
文件“/usr/lib64/python3.6/distutils/spawn.py”,第159行,在\u spawn\u posix中
%(cmd,退出状态)
distutils.errors.DistutilsExecError:命令“gcc”失败,退出状态为1
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py”,第262行,内部版本扩展名
构建外部。构建外部。构建扩展(自)
文件“/usr/lib64/python3.6/distutils/command/build\u ext.py”,第448行,内置扩展名
self.\u build\u extensions\u serial()
文件“/usr/lib64/python3.6/distutils/command/build\u ext.py”,第473行,在“build\u extensions\u serial”中
自构建扩展(ext)
文件“/opt/python/run/venv/local/lib/python3.6/site packages/setuptools/command/build\u ext.py”,第208行,内部版本扩展名
_build\u ext.build\u扩展(self,ext)
文件“/usr/lib64/python3.6/distutils/command/build\u ext.py”,第533行,内部版本扩展名
dependens=ext.dependens)
文件“/usr/lib64/python3.6/distutils/ccompiler.py”,第574行,编译中
自我编译(obj、src、ext、cc参数、额外的postargs、pp选项)
文件“/tmp/pip-build-h4kd5_1k/grpcio/src/python/grpcio/commands.py”,第246行,新编译
pp_选项)
文件“/usr/lib64/python3.6/distutils/unixcompiler.py”,第129行,在编译中
提高编译器错误(msg)
distutils.errors.CompileError:命令“gcc”失败,退出状态为1
----------------------------------------
命令“/opt/python/run/venv/bin/python3.6-u-c”导入setuptools,标记化__文件\'/tmp/pip-build-h4kd5 \'u 1k/grpcio/setup.py';f=getattr(标记化“打开”,打开)(_文件);code=f.read().replace('\r\n','\n');f、 close();exec(compile(code,_ufile,_u,'exec'))“安装--record/tmp/pip-okr6a_v3-record/install-record.txt--外部管理的单一版本--编译--install headers/opt/python/run/venv/include/site/python3.6/grpcio”失败,错误代码为1,出现在/tmp/pip-build-h4kd5\u 1k/grpcio中/
您使用的是pip版本9.0.1,但版本20.0.2可用。
您应该考虑通过“PIP安装升级PIP”命令进行升级。
2020-04-22 23:07:23479错误E
ERROR: google-api-core 1.17.0 has requirement google-auth<2.0dev,>=1.14.0, but you'll have google-auth 1.5.0 which is incompatible.
ERROR: google-cloud-storage 1.27.0 has requirement google-auth<2.0dev,>=1.11.0, but you'll have google-auth 1.5.0 which is incompatible.
ERROR: firebase-admin 4.0.0 has requirement google-api-python-client>=1.7.8, but you'll have google-api-python-client 1.7.3 which is incompatible.