LoginSignup
1
0

More than 5 years have passed since last update.

pycurlをmacOS Sierraで動くようにする

Posted at

まだ Sierraなの?

ほっとけ、会社勤めだといろいろあるんや。。。

これが出て辛かった

$ python -c "import pycurl"
pycurl: libcurl link-time ssl backend (none/other) is different from compile-time ssl backend (openssl)

none/otherってなんやねん

$ /usr/bin/curl --version
curl 7.54.0 (x86_64-apple-darwin16.0) libcurl/7.54.0 SecureTransport zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets 

SecureTransportってなに?

こうあって欲しい

$ curl --version
curl 7.61.1 (x86_64-apple-darwin16.7.0) libcurl/7.61.1 OpenSSL/1.0.2p zlib/1.2.8
Release-Date: 2018-09-05
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy 

とりあえずcurl

brew uninstall curl
brew install --force curl --with-openssl
echo 'export PATH="/usr/local/opt/curl/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

これであって欲しい姿になった。

そして、pycurl

PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install --no-cache-dir --user pycurl

多謝

Installing PycURL on macOS High Sierra

いいたいこと

requestつかってくれ、お願いだから。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0