我目前正在尝试将django应用程序部署到我的AWS弹性beanstalk。我正在使用eb命令行工具。
不幸的是,它在YUM和requirements.txt中失败了。
但是,我认为有一个更好的过程,而不是尝试谷歌包名称。 不幸的是我找不到任何官方的亚马逊图像yum存储库。
您如何找到包裹名称?
我的100个最后日志:
-------------------------------------
/var/log/eb-activity.log
-------------------------------------
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9wom8lzp/MySQL-python
2015-04-13 05:17:35,549 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install --use-mirrors -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 34, in main
install_dependencies()
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 29, in install_dependencies
check_call('%s install --use-mirrors -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: Using base prefix '/usr'
New python executable in /opt/python/run/venv/bin/python3.4
Not overwriting existing python script /opt/python/run/venv/bin/python (you must use /opt/python/run/venv/bin/python3.4)
Installing setuptools, pip...done.
Running virtualenv with interpreter /usr/bin/python3.4
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
DEPRECATION: --use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.
Collecting Django==1.7.4 (from -r /opt/python/ondeck/app/requirements.txt (line 1))
Using cached Django-1.7.4-py2.py3-none-any.whl
Collecting MySQL-python==1.2.5 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
Using cached MySQL-python-1.2.5.zip
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9wom8lzp/MySQL-python
2015-04-13 05:17:35,549 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install --use-mirrors -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 34, in main
install_dependencies()
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 29, in install_dependencies
check_call('%s install --use-mirrors -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
[2015-04-13T05:17:35.554Z] INFO [551] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/03deploy.py] : Activity failed.
[2015-04-13T05:17:35.554Z] INFO [551] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2015-04-13T05:17:35.554Z] INFO [551] - [CMD-AppDeploy/AppDeployStage0] : Activity failed.
[2015-04-13T05:17:35.555Z] INFO [551] - [CMD-AppDeploy] : Completed activity. Result:
Command CMD-AppDeploy failed.
[2015-04-13T05:18:19.483Z] INFO [686] - [CMD-TailLogs] : Starting activity...
[2015-04-13T05:18:19.700Z] INFO [686] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2015-04-13T05:18:19.700Z] INFO [686] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2015-04-13T05:18:19.700Z] INFO [686] - [CMD-TailLogs/TailLogs] : Starting activity...
[2015-04-13T05:18:19.700Z] INFO [686] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
[2015-04-13T05:18:19.876Z] INFO [686] - [CMD-TailLogs/TailLogs/TailLogs] : Completed activity.
[2015-04-13T05:18:19.876Z] INFO [686] - [CMD-TailLogs/TailLogs] : Completed activity. Result:
Command CMD-TailLogs stage 0 completed.
[2015-04-13T05:18:19.876Z] INFO [686] - [CMD-TailLogs/AddonsAfter] : Starting activity...
[2015-04-13T05:18:19.876Z] INFO [686] - [CMD-TailLogs/AddonsAfter] : Completed activity.
[2015-04-13T05:18:19.876Z] INFO [686] - [CMD-TailLogs] : Completed activity. Result:
Command CMD-TailLogs succeeded.
[2015-04-13T05:20:07.311Z] INFO [715] - [CMD-TailLogs] : Starting activity...
[2015-04-13T05:20:07.530Z] INFO [715] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2015-04-13T05:20:07.530Z] INFO [715] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2015-04-13T05:20:07.531Z] INFO [715] - [CMD-TailLogs/TailLogs] : Starting activity...
[2015-04-13T05:20:07.531Z] INFO [715] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
-------------------------------------
/var/log/eb-commandprocessor.log
-------------------------------------
You should consider upgrading via the 'pip install --upgrade pip' command.
DEPRECATION: --use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.
Collecting Django==1.7.4 (from -r /opt/python/ondeck/app/requirements.txt (line 1))
Using cached Django-1.7.4-py2.py3-none-any.whl
Collecting MySQL-python==1.2.5 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
Using cached MySQL-python-1.2.5.zip
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup.py", line 13, in <module>
from setup_posix import get_config
File "/tmp/pip-build-9wom8lzp/MySQL-python/setup_posix.py", line 2, in <module>
from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-9wom8lzp/MySQL-python
2015-04-13 05:17:35,549 ERROR Error installing dependencies: Command '/opt/python/run/venv/bin/pip install --use-mirrors -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 34, in main
install_dependencies()
File "/opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py", line 29, in install_dependencies
check_call('%s install --use-mirrors -r %s' % (os.path.join(APP_VIRTUAL_ENV, 'bin', 'pip'), requirements_file), shell=True)
File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
[2015-04-13T05:17:35.555Z] ERROR [551] : Command CMD-AppDeploy failed!
[2015-04-13T05:17:35.555Z] INFO [551] : Command processor returning results:
{"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"(TRUNCATED).../lib64/python2.7/subprocess.py\", line 540, in check_call\n raise CalledProcessError(retcode, cmd)\nCalledProcessError: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. \nHook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI","returncode":1,"events":[{"msg":"Your requirements.txt is invalid. Snapshot your logs for details.","severity":"ERROR","timestamp":1428902255},{"msg":"Error installing dependencies: Command '/opt/python/run/venv/bin/pip install --use-mirrors -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1","severity":"SYSTEM","timestamp":1428902255}]}],"truncated":"true"}
[2015-04-13T05:18:19.481Z] DEBUG [686] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2015-04-13T05:18:19.481Z] INFO [686] : Received command CMD-TailLogs: #<ElasticBeanstalk::CommandRequest:0x007f351dac2ae8>
[2015-04-13T05:18:19.481Z] DEBUG [686] : Checking if the command processor should execute...
[2015-04-13T05:18:19.482Z] DEBUG [686] : Checking whether the command is applicable to instance (i-59932798)..
[2015-04-13T05:18:19.482Z] INFO [686] : Command is applicable to this instance (i-59932798)..
[2015-04-13T05:18:19.482Z] DEBUG [686] : Checking if the received command stage is valid..
[2015-04-13T05:18:19.482Z] INFO [686] : No stage_num in command. Valid stage..
[2015-04-13T05:18:19.482Z] INFO [686] : Command processor should execute command.
[2015-04-13T05:18:19.482Z] DEBUG [686] : Storing current stage..
[2015-04-13T05:18:19.482Z] DEBUG [686] : Stage_num does not exist. Not saving null stage. Returning..
[2015-04-13T05:18:19.483Z] INFO [686] : Executing command: CMD-TailLogs...
[2015-04-13T05:18:19.483Z] DEBUG [686] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2015-04-13T05:18:19.483Z] DEBUG [686] : Refreshing metadata..
[2015-04-13T05:18:19.697Z] DEBUG [686] : Refreshed environment metadata.
[2015-04-13T05:18:19.697Z] DEBUG [686] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
[2015-04-13T05:18:19.698Z] DEBUG [686] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
[2015-04-13T05:18:19.698Z] INFO [686] : Found enabled addons: ["logpublish"].
[2015-04-13T05:18:19.699Z] INFO [686] : Updating Command definition of addon logpublish.
[2015-04-13T05:18:19.700Z] DEBUG [686] : Loaded definition of Command CMD-TailLogs.
[2015-04-13T05:18:19.700Z] INFO [686] : Executing command CMD-TailLogs activities...
[2015-04-13T05:18:19.700Z] DEBUG [686] : Setting environment variables..
[2015-04-13T05:18:19.700Z] INFO [686] : Running AddonsBefore for command CMD-TailLogs...
[2015-04-13T05:18:19.700Z] DEBUG [686] : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
[2015-04-13T05:18:19.700Z] INFO [686] : Running stage 0 of command CMD-TailLogs...
[2015-04-13T05:18:19.700Z] DEBUG [686] : Loaded 1 actions for stage 0.
[2015-04-13T05:18:19.700Z] INFO [686] : Running 1 of 1 actions: TailLogs...
[2015-04-13T05:18:19.876Z] INFO [686] : Running AddonsAfter for command CMD-TailLogs...
[2015-04-13T05:18:19.876Z] INFO [686] : Command CMD-TailLogs succeeded!
[2015-04-13T05:18:19.877Z] INFO [686] : Command processor returning results:
{"status":"SUCCESS","api_version":"1.0","results":[{"status":"SUCCESS","msg":"","returncode":0,"events":[{"msg":"[Instance: i-59932798] Successfully finished tailing 7 log(s)","severity":"INFO","timestamp":1428902299876}]}]}
[2015-04-13T05:20:07.309Z] DEBUG [715] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2015-04-13T05:20:07.309Z] INFO [715] : Received command CMD-TailLogs: #<ElasticBeanstalk::CommandRequest:0x007f2b689eaad0>
[2015-04-13T05:20:07.309Z] DEBUG [715] : Checking if the command processor should execute...
[2015-04-13T05:20:07.310Z] DEBUG [715] : Checking whether the command is applicable to instance (i-59932798)..
[2015-04-13T05:20:07.310Z] INFO [715] : Command is applicable to this instance (i-59932798)..
[2015-04-13T05:20:07.310Z] DEBUG [715] : Checking if the received command stage is valid..
[2015-04-13T05:20:07.310Z] INFO [715] : No stage_num in command. Valid stage..
[2015-04-13T05:20:07.310Z] INFO [715] : Command processor should execute command.
[2015-04-13T05:20:07.310Z] DEBUG [715] : Storing current stage..
[2015-04-13T05:20:07.311Z] DEBUG [715] : Stage_num does not exist. Not saving null stage. Returning..
[2015-04-13T05:20:07.311Z] INFO [715] : Executing command: CMD-TailLogs...
[2015-04-13T05:20:07.311Z] DEBUG [715] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties
[2015-04-13T05:20:07.311Z] DEBUG [715] : Refreshing metadata..
[2015-04-13T05:20:07.528Z] DEBUG [715] : Refreshed environment metadata.
[2015-04-13T05:20:07.528Z] DEBUG [715] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands..
[2015-04-13T05:20:07.529Z] DEBUG [715] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands..
[2015-04-13T05:20:07.529Z] INFO [715] : Found enabled addons: ["logpublish"].
[2015-04-13T05:20:07.530Z] INFO [715] : Updating Command definition of addon logpublish.
[2015-04-13T05:20:07.530Z] DEBUG [715] : Loaded definition of Command CMD-TailLogs.
[2015-04-13T05:20:07.530Z] INFO [715] : Executing command CMD-TailLogs activities...
[2015-04-13T05:20:07.530Z] DEBUG [715] : Setting environment variables..
[2015-04-13T05:20:07.530Z] INFO [715] : Running AddonsBefore for command CMD-TailLogs...
[2015-04-13T05:20:07.530Z] DEBUG [715] : Running stages of Command CMD-TailLogs from stage 0 to stage 0...
[2015-04-13T05:20:07.530Z] INFO [715] : Running stage 0 of command CMD-TailLogs...
[2015-04-13T05:20:07.531Z] DEBUG [715] : Loaded 1 actions for stage 0.
[2015-04-13T05:20:07.531Z] INFO [715] : Running 1 of 1 actions:
... TailLogs
我实际需要安装的内容(我来自debian系统):
libmysqlclient-dev libssl-dev libffi-dev python-dev
和我的requriements.txt:
Django==1.7.4
MySQL-python==1.2.5
Pillow==2.7.0
PyPDF2==1.24
argparse==1.2.1
cffi==0.8.6
cryptography==0.7.2
diff-match-patch==20121119
django-braces==1.4.0
django-cors-headers==1.0.0
django-debug-toolbar==1.2.2
django-import-export==0.2.6
django-ipware==0.1.1
django-summernote==0.6.3
django-xsendfile==1.0
enum34==1.0.4
geoip2==2.1.0
ipaddr==2.1.11
maxminddb==1.1.1
paypalrestsdk==1.8.0
pyOpenSSL==0.14
pyasn1==0.1.7
pycparser==2.10
pycrypto==2.6.1
reportlab==3.1.44
requests==2.5.1
shortuuid==0.4.2
six==1.9.0
sqlparse==0.1.14
suds==0.4
tablib==0.10.0
wsgiref==0.1.2
答案 0 :(得分:0)
ConfigParser已在python3中重命名为configparser(您在上面使用它)。
您可以尝试configparser2
module在python2中使用相同的配置程序。
将其添加到requirements或pip install configparser2
中,然后使用以下简单的内容:
try:
import configparser
except ImportError as e:
import configparser2 as configparser