无法通过elasticbeanstalk分发django项目

时间:2019-08-15 08:58:40

标签: django amazon-elastic-beanstalk software-distribution

我想分发一个django项目以使用ElasticBeanStalk。 但是当我执行eb create代码时会出现问题。 老实说,我看到了数百个有关此问题的文档。 有人说这是pillow软件包问题,pip问题等。 但是我认为这是一个PYTHONPATH问题。 这是我的错误代码和ElasticBeanStalk应用程序日志。

2019-08-14 04:56:44    ERROR   Your requirements.txt is invalid. Snapshot your logs for details.
2019-08-14 04:56:48    ERROR   [Instance: i-0e32d61b630bb7337] 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.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

此处的EB日志

/var/log/eb-activity.log

  Collecting future==0.16.0 (from -r /opt/python/ondeck/app/requirements.txt (line 13))
Downloading https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz (824kB)
  Collecting idna==2.7 (from -r /opt/python/ondeck/app/requirements.txt (line 14))

Could not find a version that satisfies the requirement pywin32==224 (from -r /opt/python/ondeck/app/requirements.txt (line 22)) (from versions: )
  No matching distribution found for pywin32==224 (from -r /opt/python/ondeck/app/requirements.txt (line 22))
  You are using pip version 9.0.1, however version 19.2.2 is available.
  You should consider upgrading via the 'pip install --upgrade pip' command.
  2019-08-14 04:56:44,147 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/ondeck/app/requirements.txt' returned non-zero exit status 1 

该错误日志显示我的pip版本是旧版本(9.0.1)。 因此,我应该安装最新版本(19.2.2)。 但是我安装了pip所有最新版本,带有virtualenv和默认的cmd。 当我在git bash中编写代码pip -V时,  来自c:\ users \ dong hwa \ appdata \ local \ programs \ python \ python36 \ lib \ site-packages \ pip的pip 19.2.2(python 3.6) 另外我也不了解opt / python / ondeck / app。 在elasticbeanstalk创建错误中,因为它无效,所以显示了requirements.txt问题。但是我看到了有关requirements.txt错误的文档。也就是说,这不是require.txt错误,而是查看EB日志。 请帮助我。

0 个答案:

没有答案