2016-03-19 30 views
2

我正在部署和使用彈性beanstalk。當我做EB創造,我讓你requirements.txt是無效的,當我看清楚我得到兩個錯誤在庫libxml2中找不到函數xmlCheckVersion。是否安裝了libxml2?錯誤:命令'gcc'失敗,退出狀態1

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? 
    ********************************************************************************* 
    error: command 'gcc' failed with exit status 1 

我不知道什麼我可能做更多,我試圖 卸載枕頭 然後sudo apt-get install libjpeg-dev 安裝pillow回 和pip install lxml

我試圖

sudo apt-get install libxml2-dev libxslt1-dev python-dev 

apt-get install libxml2-dev libxslt1-dev python-dev 

我只是想部署我有什麼,但這個枕頭的事情是抓住我的腳踝,你可以幫我

我需要什麼,也許在這裏?

packages: 
     yum: 
     git: [] 
     postgresql93-devel: [] 
     libjpeg-turbo-devel: [] 
     libpng-devel: [] 
     freetype-devel: [] 


container_commands: 
    01_migrate: 
    command: "source /opt/python/run/venv/bin/activate && python ebagu/manage.py migrate --noinput" 
    leader_only: true 
    02_createsu: 
    command: "source /opt/python/run/venv/bin/activate && python ebagu/manage.py createsu" 
    leader_only: true 
    03_collectstatic: 
    command: "source /opt/python/run/venv/bin/activate && python ebagu/manage.py collectstatic --noinput" 
    04_uninstall_pil: 
    command: "source /opt/python/run/venv/bin/activate && yes | pip uninstall Pillow" 

    05_reinstall_pil: 
    command: "source /opt/python/run/venv/bin/activate && yes | pip install Pillow --no-cache-dir" 


option_settings: 
    "aws:elasticbeanstalk:application:environment": 
    DJANGO_SETTINGS_MODULE: "app.settings" 
    "PYTHONPATH": "/opt/python/current/app/app:$PYTHONPATH" 
    "aws:elasticbeanstalk:container:python": 
    WSGIPath: app/app/wsgi.py 
    NumProcesses: 3 
    NumThreads: 20 
    "aws:elasticbeanstalk:container:python:staticfiles": 
    "/static/": "www/static/" 
+0

安裝'的libxml2-dev'解決了這個錯誤我。 –

回答

1

亞馬遜的彈性魔豆目前不支持apt-get的包管理器,以便在您的配置文件中看到默認yum必須使用。您可以手動安裝枕頭的依賴關係,如果您要ssh進入服務器使用

sudo yum install libxml2-devel libxslt-devel libjpeg-turbo-devel 

(也請注意不同的軟件包名稱)。或者最好作爲配置文件的補充,以便在部署時根據需要進行安裝。

packages: 
    yum: 
    # Your other non-python packages 
    libxml2-devel: [] 
    libxslt-devel: [] 
    libjpeg-turbo-devel: [] 
0

試試這個對Ubuntu:

sudo apt-get install -y libxml2-dev libxslt1-dev zlib1g-dev python3-pip 
0

我只是試圖利用彈性魔豆(AMI 2017.03)部署的EC2實例中安裝lxml時完全相同的錯誤,就像在原來的問題。這個問題只發生在Python 3.5和Python 2.7上,我可以毫無困難地安裝它。

在我的情況下,問題是沒有安裝GCC。做sudo yum install gcc解決了它。

我認爲問題在於Amazon AMI存儲庫不包含libxml2的Python 3綁定的二進制包。 Python 2.6和2.7(python2X-lxml)的綁定可用,這就是爲什麼Python 2中的所有東西都可以使用。但是,當使用pip-3.5時,pip找不到它們並嘗試從源代碼安裝它們,此時它需要GCC 。

我的豆莖彈性配置文件的packages部分看起來是這樣的:

packages: 
    yum: 
     gcc: [] 
     python35: [] 
     python35-pip: [] 
     python35-devel: [] 
     libxml2-devel: [] 
     libxslt-devel: [] 
相關問題