我正在尝试在弹性 beanstalk 实例上安装 peewee 包来控制瓶子应用程序。我认为问题出在 MySQL-python 依赖项上,但 peewee 也没有加载。我的需求文件如下所示:
bottle==0.11.6
peewee==2.1.1
MySQL-python
我也试过MySQL-python
了MySQL-python==1.2.4b4
。由于我认为这里总结了许多原因,这是行不通的;peewee 未安装,我在日志中收到此错误消息:
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'.
所以 pip 不适用于这些包。我很确定我可以通过连接到 EC2 实例并在没有 pip 的情况下安装 MySQL-python 来解决这个问题,但在我看来,这会破坏弹性 beanstalk 的目的,因为每次启动新实例时都需要我去并手动修改它。我有没有合适的方法来处理这个问题?我在尝试安装 scipy 和 matplotlib 之类的东西时也遇到了同样的问题,那么广泛地说,有没有一种方法可以在没有 pip 的情况下在弹性 beanstalk 实例上安装 python 包,并且无需单独进入每个实例?我是否应该研究如何制作自定义 AMI 并在 beanstalk 上使用它?非常感谢,亚历克斯