gpt4 book ai didi

python - 在 Alpine Linux 上安装 pycurl 时出现 “Could not run curl-config: [Errno 2] No such file or directory”

转载 作者:太空宇宙 更新时间:2023-11-04 00:15:58 27 4
gpt4 key购买 nike

我正在尝试通过以下方式安装 pycurl:

sudo pip install pycurl

它下载正常,但是当它运行 setup.py 时,我得到以下回溯:

Downloading/unpacking pycurl
Running setup.py egg_info for package pycurl
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pycurl/setup.py", line 563, in <module>
ext = get_extension()
File "/tmp/pip-build-root/pycurl/setup.py", line 368, in get_extension
ext_config = ExtensionConfiguration()
File "/tmp/pip-build-root/pycurl/setup.py", line 65, in __init__
self.configure()
File "/tmp/pip-build-root/pycurl/setup.py", line 100, in configure_unix
raise ConfigurationError(msg)
__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pycurl/setup.py", line 563, in <module>
ext = get_extension()
File "/tmp/pip-build-root/pycurl/setup.py", line 368, in get_extension
ext_config = ExtensionConfiguration()
File "/tmp/pip-build-root/pycurl/setup.py", line 65, in __init__
self.configure()
File "/tmp/pip-build-root/pycurl/setup.py", line 100, in configure_unix
raise ConfigurationError(msg)

__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory

知道为什么会发生这种情况以及如何使用 Alpine Linux 解决这个问题吗?

最佳答案

找到了。我相信这行得通。

# Install packages
apk add --no-cache libcurl

# Needed for pycurl
ENV PYCURL_SSL_LIBRARY=openssl

# Install packages only needed for building, install and clean on a single layer
RUN apk add --no-cache --virtual .build-dependencies build-base curl-dev \
&& pip install pycurl \
&& apk del .build-dependencies

关于python - 在 Alpine Linux 上安装 pycurl 时出现 “Could not run curl-config: [Errno 2] No such file or directory”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50973815/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com