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

前端 未结 1 1375
终归单人心
终归单人心 2020-12-20 15:06

I\'m having difficulties with the --global-option and --install-option settings for a requirements.txt file. Specifying the options for one library is causing other librarie

相关标签:
1条回答
  • 2020-12-20 15:54

    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...

    0 讨论(0)
提交回复
热议问题