I wanted to run python file. But I could check this error when I ran it.
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
My system is Mac os 10.13.2 and I used python 2.7
I wanted to run python file. But I could check this error when I ran it.
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
My system is Mac os 10.13.2 and I used python 2.7
Looks like something went wrong with pycurl/openssl, try this:
pip uninstall pycurl
pip install --compile --install-option="--with-openssl" pycurl
if still fails, try this as well
brew reinstall openssl
brew reinstall openssl
was required on an upgraded macOS 10.13 machine –
Prussianism poetry add pycurl
doesn't seem to give the option of supplying flags. –
Riobard brew reinstall openssl
you can run brew info openssl
and it will tell you some environment variables you need to set for the pycurl install to work. –
Cybil brew info openssl
and pass it to pip: pip install --compile --install-option="--with-openssl" --install-option="--openssl-dir=/opt/homebrew/opt/openssl@3/" pycurl
–
Sudanic pip install --compile --config-settings="--build-option=--with-openssl --openssl-dir=/opt/homebrew/opt/openssl@3/" pycurl
–
Quennie This was done by my fellow mac users.
# pycurl
pip uninstall pycurl
export CPPFLAGS=-I/usr/local/opt/openssl/include # may be needed
export LDFLAGS=-L/usr/local/opt/openssl/lib # may be needed
pip install --no-cache-dir --compile --ignore-installed --install-option="--with-openssl" pycurl
I got this same issue in windows which had a different fix(perhaps this might fit Mac too). In my requirements.txt I had pycurl-7.43.0.4
but on the windows dowloader page I could only find 7.44.1
which I installed (pip install .\pycurl-7.44.1-cp37-cp37m-win_amd64.whl
). And then on starting my Django server python manage.py runserver
I got the error in question. And the solution was to bring the pycurl back to it's expected version. pip install pycurl==7.43.0.5
and it replaced the version as given below. And the error was gone!
How I resolve this issue on my Mac Book Pro M1 (Chip Apple M1 Pro).
I am using system provided Python 3.9.6 as MacOs Monterey 12.6 completely removed Python 2.7 and providing Python 3.9.6 as system Python.
two thing is very important to know curl info by using
curl-config --features
brew openssl info
this gives you information according to your own machine setup for using in below installation to use.
In my case it was
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
For pkg-config to find openssl@3 you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
pip install --no-cache-dir --compile --ignore-installed --install-option="--with-openssl" pycurl
it was done!!! perfectly.
Alternatively, if you get an error saying
no such option: --install-option
You can try:
env PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" pip install --no-cache-dir --compile --ignore-installed pycurl
and it should work!
For m1 users, it works for me
brew install curl-openssl
pip uninstall pycurl
PYCURL_SSL_LIBRARY=openssl \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
CPPFLAGS="-I$(brew --prefix openssl)/include"
pip install --compile --install-option="--with-openssl" pycurl
--use-pep517
in addition: pip install --no-cache-dir --ignore-installed --compile --install-option="--with-openssl" pycurl --use-pep517
–
Undersecretary --install-option
is not an option for later versions of pip –
Bipartite Setup: MacOS Ventura, M1, Python 3.9, pip 23.1.2
With pip 23.1, --install-option="..."
is deprecated.
What worked for me was actually following the installation guide from pycurl: http://pycurl.io/docs/latest/install.html#easy-install-pip
pip3 uninstall pycurl
brew install curl-openssl
export PYCURL_SSL_LIBRARY=openssl
pip3 install --no-cache-dir --ignore-installed --compile pycurl
Reinstall the curl libraries
brew install curl --with-openssl
Install pycurl with correct environment and paths
export PYCURL_SSL_LIBRARY=openssl
pip uninstall pycurl
pip install --no-cache-dir --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include" pycurl
invalid option: --with-openssl
–
Dilapidate On macOS Catalina (v10.15.6), make sure you uninstall previous curl
then install curl-openssl
as well as exporting variables so compiler can find them:
brew uninstall curl
brew install curl-openssl
export PYCURL_SSL_LIBRARY=openssl
export PYCURL_CURL_CONFIG=/usr/local/opt/curl-openssl/bin/curl-config;export LDFLAGS='-L/usr/local/opt/openssl/lib -L/usr/local/opt/c-ares/lib -L/usr/local/opt/nghttp2/lib -L/usr/local/opt/libmetalink/lib -L/usr/local/opt/rtmpdump/lib -L/usr/local/opt/libssh2/lib -L/usr/local/opt/openldap/lib -L/usr/local/opt/brotli/lib';export CPPFLAGS=-I/usr/local/opt/openssl/include;pip install pycurl --compile --no-cache-dir
pip install pycurl
ARCHFLAGS="-arch x86_64" pip install pycurl --compile --no-cache-dir
–
Tice export PYCURL_SSL_LIBRARY=openssl export PYCURL_CURL_CONFIG=/opt/homebrew/opt/curl/bin/curl-config export LDFLAGS='-L/opt/homebrew/opt/openssl/lib/' export CPPFLAGS=-I/opt/homebrew/opt/openssl/include pip install pycurl --compile --no-cache-dir
–
Reneareneau I am running MacOS Ventura on my MacBook Pro. We use Python 3.7. The following worked for me:
% python3.7 -m pip uninstall pycurl
% brew install curl
% brew install openssl
% export LDFLAGS="-L/usr/local/opt/curl/lib $LDFLAGS"
% export CPPFLAGS="-I/usr/local/opt/curl/include $CPPFLAGS"
% export PKG_CONFIG_PATH=/usr/local/opt/curl/lib/pkgconfig
% python3.7 -m pip install pycurl==7.45.2 --no-cache-dir --compile --ignore-installed --install-option="--openssl-dir=/usr/local/opt/openssl@3/"
© 2022 - 2024 — McMap. All rights reserved.