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

标签 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? )将其添加到我的 requests.txt 文件中,如下所示:

pycurl==7.43.0 --global-option="--with-nss"

这导致:

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'

我不清楚出了什么问题。

当我通过 ssh 进入 EBS 实例并尝试了解如何解决该问题时,我可以看到有关正在使用的 pip 版本的警告:

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.

但是当我尝试升级时:

源/opt/python/run/venv/bin/activate pip安装--升级pip

我收到权限错误:

    Exception:
Traceback (most recent call last):
  File "/opt/python/run/venv/lib64/python3.6/shutil.py", line 550, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/opt/python/run/venv/bin/pip' -> '/tmp/pip-5y1ipdun-uninstall/opt/python/run/venv/bin/pip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/opt/python/run/venv/local/lib/python3.6/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/opt/python/run/venv/lib64/python3.6/shutil.py", line 565, in move
    os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/opt/python/run/venv/bin/pip'

我有点陷入困境,非常感谢任何有关如何克服这个问题的建议。

最佳答案

添加这些对我有用

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

关于python - 无法在 AWS Elastic Beanstalk 上安装 pycurl==7.43.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58593239/

相关文章:

c# - 如何告诉我的 Elastic Beanstalk 实例不要进入休眠状态?

amazon-web-services - 通过 AWS CLI 查找 Beanstalk VPC-ID

Python:urlopen() 与 CURL

python - 将 PyCURL 安装到特定版本的 Python

python - 构建后如何运行Docker命令?

python - OSError : Could not find geos_c. dll 或加载其任何变体

python - 一种在累积和变大的数组中查找索引的快速 numpy 方法?

python - 如何将图像的像素值复制到另一个python变量以使该python变量将图像保存在opencv中

python - 如何删除字符串值上的 '\n' 或将 ByteIO 正确转换为列表?

python - 如何从一个 Flask View 调用另一个 View ?