无法在AWS Elastic Beanstalk上安装pycurl == 7.43.0

时间:2019-10-28 14:56:34

标签: python amazon-elastic-beanstalk pycurl

我正在Django应用程序上开发Elastic Beanstalk,在devops方面我有点天真。

我在安装pycurl时遇到问题,已建议我(使用其他SO线程How to run a celery worker with Django app scalable by AWS Elastic Beanstalk?)将pycurl添加到我的requirements.txt文件中,如下所示:

pycurl == 7.43.0 --global-option =“-with-nss”

哪个会导致:

public static void main(String[] args) {
    Random rand = new Random();
    String[][] couples = {{"x1","y1"},{"x2","y2"},{"x3","y3"},{"x4","y4"},{"x5","y5"}};
    int rnd1 = rand.nextInt(couples.length);
    int rnd2 = rand.nextInt(couples[rnd1].length);
    System.out.println(couples[rnd1][rnd2]);
}

我不清楚发生了什么问题。

当我进入EBS实例尝试并学习如何解决它时,我会看到有关使用中的pip版本的警告:

ERROR: Command errored out with exit status 1:
       command: /opt/python/run/venv/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-04ket6ba/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-04ket6ba/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-04ket6ba/pycurl/pip-egg-info
           cwd: /tmp/pip-install-04ket6ba/pycurl/
      Complete output (22 lines):
      Traceback (most recent call last):
        File "/tmp/pip-install-04ket6ba/pycurl/setup.py", line 103, in configure_unix
          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
          restore_signals, start_new_session)
        File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'curl-config': 'curl-config'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/tmp/pip-install-04ket6ba/pycurl/setup.py", line 823, in <module>
          ext = get_extension(sys.argv, split_extension_source=split_extension_source)
        File "/tmp/pip-install-04ket6ba/pycurl/setup.py", line 497, in get_extension
          ext_config = ExtensionConfiguration(argv)
        File "/tmp/pip-install-04ket6ba/pycurl/setup.py", line 71, in __init__
          self.configure()
        File "/tmp/pip-install-04ket6ba/pycurl/setup.py", line 107, in configure_unix
          raise ConfigurationError(msg)
      __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config': 'curl-config'

但是当我尝试升级时:

You are using pip version 9.0.1, however version 19.3.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

我收到权限错误:

source /opt/python/run/venv/bin/activate
pip install --upgrade pip

我有些困惑,不胜感激如何克服这个问题的任何建议。

2 个答案:

答案 0 :(得分:0)

我通过将以下内容添加到我的EBS config.yml文件中来解决此问题:

packages:
    yum:
        libcurl-devel: []
        libcurl4-openssl-dev: []
        libssl-dev: []
        python-pycurl: [7.19.3]

答案 1 :(得分:0)

添加这些对我有用

packages:
  yum:
    libcurl-devel: []
    openssl-devel: []