Pip Requirements.txt --global-option causing installation errors with other packages. “option not recognized”

非 Y 不嫁゛ 提交于 2019-11-29 13:51:23
smentek

Your problem comes from the fact that PIP version on EC2 with EB is quite old and does not understand your options.

  1. Update pip lib to latest available version with EB commands:

project_dir/.ebextensions/02-python.config:

...
commands:
  01_upgrade_pip_for_venv:
    command: "/opt/python/run/venv/bin/pip install --upgrade pip"
...
  1. Now you can leave options in requirement.txt since new version of pip will be able to work with it.

project_dir/requirements.txt:

...
pycurl==7.43.0 --global-option="--with-nss"
...
  1. (This may be redundant) Set option in EB console user interfaces or by eb CLI with command:

    eb setenv PYCURL_SSL_LIBRARY=nss

  2. Push changes to repository and Rebuild. You may have errors since execution is controlled from external scope and started with old version of PIP. Entry point of execution is outside of app on EC2 instance so I'm not sure how to bring solution that would work from scope of hooks on first deployment... But all you have to do is to deploy again, and it will use proper version of PIP, so it will work from now on, till next rebuild...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!