"Could not run curl-config: [Errno 2] No such file or directory" when installing pycurl
135,446
Solution 1
On Debian I needed the following packages to fix this
sudo apt install libcurl4-openssl-dev libssl-dev
Solution 2
Similarly with yum
package manager
yum install libcurl-devel
If you use dnf
, use
dnf install libcurl-devel
Solution 3
in my case this fixed the problem:
sudo apt-get install libssl-dev libcurl4-openssl-dev python-dev
as explained here
Solution 4
In Alpine linux you should do:
apk add curl-dev python3-dev libressl-dev
Solution 5
Same solution provided by @Michael Rice works for Ubuntu 18.04 as well
Ubuntu 18.04 LTS
sudo apt install libcurl4-openssl-dev libssl-dev
Al thought it is mentioned in comments of Michael's answer but thought highlight for easy of use.
Related videos on Youtube

Author by
user3688241
Updated on March 23, 2021Comments
-
user3688241 over 1 year
I'm trying to install pycurl via:
sudo pip install pycurl
It downloaded fine, but when when it runs setup.py I get the following traceback:
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
Any idea why this is happening and how to get around it
-
sokhaty almost 5 yearsIn my case python-devel was missing as well, so the following solved the issue for me: yum install libcurl-devel python-devel
-
Skullone over 3 yearsthanks for the python-dev package! i had this error without it : src/pycurl.h:4:20: fatal error: Python.h: No such file or directory
-
ItayB over 3 years
apk add curl-dev
was enough for me in dockerpython2.7-alpine
image, thanks! -
MiroJanosik over 1 yearIt was "yum install openssl-devel.x86_64 libcurl-devel.x86_64" for me on CentOS 8