![Mac を High Sierra から Catalina にアップグレードすると、「import pycurl」が壊れる](https://rvso.com/image/1606685/Mac%20%E3%82%92%20High%20Sierra%20%E3%81%8B%E3%82%89%20Catalina%20%E3%81%AB%E3%82%A2%E3%83%83%E3%83%97%E3%82%B0%E3%83%AC%E3%83%BC%E3%83%89%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E3%80%8Cimport%20pycurl%E3%80%8D%E3%81%8C%E5%A3%8A%E3%82%8C%E3%82%8B.png)
Mac を High Sierra から Catalina にアップグレードしましたが、問題が発生しましたimport pycurl
。以下のエラーを参照してください。
ユーザーが成功したと主張するすべてのオプションを試しましたStack Overflow の投稿しかし、無駄でした。
ImportError: pycurl: libcurl link-time ssl backend (none/other) is different from compile-time ssl backend (openssl)
私のpycurlのバージョンは7.43.0.3
Pythonのバージョンは3.6.4。
[Catalinaの1.0.2tでも試してみて、libressl
以下も試しました]
% openssl version -a
LibreSSL 2.8.3
built on: date not available
platform: information not available
options: bn(64,64) rc4(16x,int) des(idx,cisc,16,int) blowfish(idx)
compiler: information not available
OPENSSLDIR: "/private/etc/ssl"
% echo $PYCURL_SSL_LIBRARY
openssl
% echo $LDFLAGS
-L/usr/local/opt/openssl/lib
% echo $CPPFLAGS
-I/usr/local/opt/openssl/include
上記のコマンドのすべての組み合わせを試しました:
% pip install --global-option="--with-openssl" --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include --compile --no-cache-dir" pycurl
% brew uninstall openssl
等
easy_installを使用しました。
しかし、それはまだ慣れたばかりだカタリナ!!誰かこれを解決しましたか?
答え1
少しハッキーな感じはしますが、次の方法は私にとってはうまくいきました。より良い解決策が出てくるまで、これを続けてみてはいかがでしょうか?
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
macOS 10.15 Python 3.7.4 pycurl 7.43.0.3 OpenSSL 1.0.2t
答え2
これは私にとってはうまくいきました
pip uninstall pycurl
pip install --compile --install-option="--with-openssl" pycurl
答え3
私は MacBook Pro で MacOS ventura を実行しています。Ptyhon 3.7 を使用しています。私の場合は次の方法がうまくいきました:
% 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/"