获取peewee工作弹性魔豆 [英] Getting peewee to work on elastic beanstalk

查看:175
本文介绍了获取peewee工作弹性魔豆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在弹性豆茎实例上安装peewee包来控制瓶的应用程序。我认为这个问题是与MySQL-python的相关性,但peewee不加载任何。我要求的文件是这样的:

I'm trying to install the peewee package on an elastic beanstalk instance to control a bottle application. I think the problem is with the MySQL-python dependency, but peewee doesn't load either. My requirements file looks like this:

bottle==0.11.6
peewee==2.1.1
MySQL-python

我也试过的MySQL-python的的MySQL-python的== 1.2.4b4 。由于一些原因,我相信这是总结了这里,这也不行; peewee未安装和我在日志中此错误消息:

I also tried MySQL-python as MySQL-python==1.2.4b4. For a number of reasons which I believe are summed up here, this doesn't work; peewee isn't installed and I get this error message in the log:

2013-05-18 06:57:08,407 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded.
2013-05-18 06:57:08,408 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Executing script: /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py
2013-05-18 06:57:18,663 [INFO] (15947 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Output from script: New python executable in /opt/python/run/venv/bin/python2.6
Not overwriting existing python script /opt/python/run/venv/bin/python (you must use /opt/python/run/venv/bin/python2.6)
Installing distribute..................................................................................................................................................................................................done.
Installing pip................done.
Requirement already satisfied (use --upgrade to upgrade): bottle==0.11.6 in /opt/python/run/venv/lib/python2.6/site-packages (from -r /opt/python/ondeck/app/requirements.txt (line 1))
Downloading/unpacking peewee==2.1.1 (from -r /opt/python/ondeck/app/requirements.txt (line 2))
  Running setup.py egg_info for package peewee
Downloading/unpacking MySQL-python (from -r /opt/python/ondeck/app/requirements.txt (line 3))
  Running setup.py egg_info for package MySQL-python
    The required version of distribute (>=0.6.28) is not available,
    and can't be installed while this script is running. Please
    install a more recent version first, using
    'easy_install -U distribute'.

    (Currently using distribute 0.6.27 (/opt/python/run/venv/lib/python2.6/site-packages/distribute-0.6.27-py2.6.egg))
    Complete output from command python setup.py egg_info:
    The required version of distribute (>=0.6.28) is not available,

and can't be installed while this script is running. Please

install a more recent version first, using

'easy_install -U distribute'.

所以,画中画没有为这些包的工作。我是pretty的肯定,我可以通过连接到EC2实例,安装MySQL-python的不点子解决这个问题,但在我看来,这个机制就失去弹性豆茎的目的,因为每当一个新的实例启动就需要我进去和手动修补。有没有一种合适的方式对我来说,解决这个问题?我也有同样的问题试图安装之类的东西SciPy的和matplotlib,如此广泛,是有办法,我可以安装在弹性魔豆实例Python包无点差,并没有进入每个单独的实例?我应该寻找到如何使一个自定义的AMI和使用它的豆茎? 多谢, 亚历克斯

So pip doesn't work for these packages. I'm pretty sure I could fix this by connecting to the EC2 instance and installing MySQL-python without pip, but it seems to me that would defeat the purpose of elastic beanstalk, since every time a new instance started it would need me to go in and tinker with it manually. Is there a proper way for me to deal with this problem? I've also had the same issue trying to install things like scipy and matplotlib, so broadly, is there a way I can install python packages on elastic beanstalk instances without pip, and without going into each instance individually? Should I be looking into how to make a custom AMI and use it on beanstalk? Thanks a lot, Alex

推荐答案

对不起,我忘了我问这个。 我最终被ssh'ing到实例,并安装MySQL,Python的使用PIP的easy_install的,而不是解决了这个问题。

Sorry I forgot I asked this. I eventually solved this issue by ssh'ing into the instance and installing MySQL-Python using easy_install instead of pip.

基本上我去了蟒蛇虚拟环境方向:

Basically I went to the python virtual environment direction at:

OPT /蟒蛇/运行/ venv /箱

和使用的easy_install安装1.2.3版本:

and installed version 1.2.3 using easy_install:

须藤./easy_install的MySQL,Python的== 1.2.3

我检查,看它是通过安装试图导入My​​SQLdb的在虚拟环境中的蟒蛇:

I checked to see it was installed by trying to import MySQLdb in the virtual environment's python:

./python

>>>import MySQLdb
>>>

和它为我工作。于是我再次推到它与弹性魔豆命令行工具重置服务器:

and it worked for me. Then I reset the server by pushing to it again with the elastic beanstalk command line tool:

混帐aws.push

和仅此而已。有点恼人必须这样做,但它似乎要继续当一个新的实例启动工作。

and that's about it. Somewhat annoying to have to do it, but it seems to continue to work when a new instance is started up.

谢谢, 亚历克斯

这篇关于获取peewee工作弹性魔豆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆