2015-08-04 2 views
1

J'ai un problème lors du déploiement de l'application Flask sur l'instance AWS EC2. Probablement avec pip en installant lxml. Mais je ne sais pas comment résoudre le problème.Exigences obligatoires.txt lors du déploiement sur AWS. Pip n'a pas pu installer lxml

AWS EC2:

Platform: 64bit Amazon Linux 2015.03 v1.4.6 running Python 2.7 

De CLI sur eb create:

CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. 

à partir de grumes:

src/lxml/lxml.etree.c:200873: error: ‘XML_XPATH_INVALID_ARITY’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:200883: error: ‘XML_XPATH_INVALID_CTXT_SIZE’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:200893: error: ‘XML_XPATH_INVALID_CTXT_POSITION’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201123: error: ‘LIBXSLT_VERSION’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201135: error: ‘xsltLibxsltVersion’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201147: error: ‘__pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201147: error: ‘xsltDocDefaultLoader’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201156: error: ‘xsltDocLoaderFunc’ undeclared (first use in this function) 
    src/lxml/lxml.etree.c:201156: error: expected ‘)’ before ‘__pyx_f_4lxml_5etree__xslt_doc_loader’ 
    error: command 'gcc' failed with exit status 1 

    ---------------------------------------- 
Command "/opt/python/run/venv/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-fJYICo/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-iWirgM-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/python/run/venv/include/site/python2.7/lxml" failed with error code 1 in /tmp/pip-build-fJYICo/lxml 
2015-08-04 07:00:15,710 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 540, 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 (Executor::NonZeroExitStatus) 


[2015-08-04T07:00:15.731Z] INFO [7052] - [CMD-Startup/StartupStage0/AppDeployPreHook/03deploy.py] : Activity failed. 
[2015-08-04T07:00:15.731Z] INFO [7052] - [CMD-Startup/StartupStage0/AppDeployPreHook] : Activity failed. 
[2015-08-04T07:00:15.731Z] INFO [7052] - [CMD-Startup/StartupStage0] : Activity failed. 
[2015-08-04T07:00:15.749Z] INFO [7052] - [CMD-Startup] : Completed activity. Result: 
Command CMD-Startup(stage 0) failed. 

Et le fichier requirements.txt:

alabaster==0.7.6 
alembic==0.7.6 
aniso8601==1.0.0 
Babel==1.3 
beautifulsoup4==4.4.0 
blinker==1.3 
boto==2.38.0 
docutils==0.12 
Flask==0.10.1 
Flask-Bower==1.2.1 
Flask-Cors==2.0.1 
Flask-DebugToolbar==0.10.0 
Flask-Login==0.2.11 
Flask-Mail==0.9.1 
Flask-RESTful==0.3.3 
Flask-WTF==0.11 
itsdangerous==0.24 
Jinja2==2.7.3 
lxml==3.4.4 
Mako==1.0.1 
Markdown==2.6.2 
MarkupSafe==0.23 
nose==1.3.6 
pep8==1.6.2 
psycopg2==2.6 
Pygments==2.0.2 
pytz==2015.4 
requests==2.7.0 
six==1.9.0 
snowballstemmer==1.2.0 
Sphinx==1.3.1 
sphinx-rtd-theme==0.1.8 
SQLAlchemy==1.0.0 
Werkzeug==0.10.4 
WTForms==2.0.2 

Tout d'abord, ai-je raison que le problème avec l'installation lxml? Si oui, savez-vous comment le résoudre pour AWS parce que sur mon ordinateur local (Mac OS 10.9.5) je n'avais pas cette erreur.

Répondre