wptools icon indicating copy to clipboard operation
wptools copied to clipboard

pycurl.error: (35, 'Unknown SSL protocol error)

Open xieexiaotuzi opened this issue 5 years ago • 10 comments

Hi, when I run "infobox = wptools.page('Nexus Q').get_parse().data['infobox']"

I always get the error "pycurl.error: (35, 'Unknown SSL protocol error in connection to en.wikipedia.org:443 ')"

In detail, Traceback (most recent call last): File "", line 1, in File "//anaconda/lib/python2.7/site-packages/wptools/page.py", line 521, in get self.get_query(False, proxy, timeout) File "//anaconda/lib/python2.7/site-packages/wptools/page.py", line 638, in get_query self._get('query', show, proxy, timeout) File "//anaconda/lib/python2.7/site-packages/wptools/core.py", line 175, in _get response = req.get(qstr, qobj.status) File "//anaconda/lib/python2.7/site-packages/wptools/request.py", line 76, in get return self.curl_perform(crl) File "//anaconda/lib/python2.7/site-packages/wptools/request.py", line 84, in curl_perform crl.perform() pycurl.error: (35, 'Unknown SSL protocol error in connection to en.wikipedia.org:443 ')

My wptools version is 0.4.17 and on Mac. Could anyone help me thanks a lot.

xieexiaotuzi avatar Aug 27 '19 09:08 xieexiaotuzi

@siznax

xieexiaotuzi avatar Aug 27 '19 09:08 xieexiaotuzi

Hi @xieexiaotuzi. Thanks again for trying wptools. I deleted my previous comment because I misunderstood the problem. It's working for me, so I think you may be blocked from accessing en.wikipedia.org for some reason.

siznax avatar Aug 29 '19 17:08 siznax

Please look into these tools: curl and openssl. For example, on my system:

$ openssl version -a
LibreSSL 2.6.5
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"

You may learn something from this command too:

$ curl -I https://en.wikipedia.org/wiki/Nexus_Q

You can use https://brew.sh/ to install these packages on Mac OS.

siznax avatar Aug 29 '19 17:08 siznax

@siznax Could be accessing issue, make sense to try using curl or wget to fetch a page to see.

I know some territory Wikipedia is blocked (like China and Iran)

lisongx avatar Aug 29 '19 21:08 lisongx

@lisongx Thanks for your answer. I try to access from U.S. using vpn and failed too. So any ideas? Thanks.

JianyuZhao7 avatar Aug 30 '19 00:08 JianyuZhao7

@JianyuZhao7 Do you have the same issue as @xieexiaotuzi ? What if you try use curl to request the en wikipedia, it would be good to see what curl returns curl -I https://en.wikipedia.org/wiki/Nexus_Q

lisongx avatar Aug 30 '19 09:08 lisongx

ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-na9bq76i/pycurl/setup.py'"'"'; file='"'"'/tmp/pip-install-na9bq76i/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info cwd: /tmp/pip-install-na9bq76i/pycurl/ Complete output (22 lines): Traceback (most recent call last): File "/tmp/pip-install-na9bq76i/pycurl/setup.py", line 229, in configure_unix stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "/usr/lib/python3.6/subprocess.py", line 729, in init restore_signals, start_new_session) File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'curl-config': 'curl-config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-na9bq76i/pycurl/setup.py", line 944, in <module>
    ext = get_extension(sys.argv, split_extension_source=split_extension_source)
  File "/tmp/pip-install-na9bq76i/pycurl/setup.py", line 606, in get_extension
    ext_config = ExtensionConfiguration(argv)
  File "/tmp/pip-install-na9bq76i/pycurl/setup.py", line 101, in __init__
    self.configure()
  File "/tmp/pip-install-na9bq76i/pycurl/setup.py", line 233, in configure_unix
    raise ConfigurationError(msg)
__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config': 'curl-config'
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

got this error trying to install

naspuka avatar Sep 12 '19 11:09 naspuka

if you are using Mac with High Serria try this: uninstall your wptools and pycurl and than do this to install pycrul pip uninstall pycurl export PYCURL_SSL_LIBRARY=openssl export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include;pip install pycurl --compile --no-cache-dir

install wptools again than see still you are getting this error.

asifkhan69 avatar Sep 30 '19 19:09 asifkhan69

@naspuka @asifkhan69 this issue is about a pycurl error, not about pycurl installation.

Please see #68 to resolve pycurl setup issues, usually related to SSL library paths.

siznax avatar Oct 09 '19 19:10 siznax

I am in China and I met the same problem. Wikipedia is blocked in China so I used VPN. At first, I wrote fela = wptools.page('Fela Kuti').get_parse(proxy='http://127.0.0.1:1080') but the same error appeared. After careful examination, I found self._set_data(action) in core.py caused this problem. This function does not pass "proxy" to afterward function but later self._get('imageinfo', show, proxy, timeout) in page.py starts a new curl with the proxy initialized to be None. Finally, 443 appeared. So I wrote crl.setopt(pycurl.PROXY,'http://127.0.0.1:1080') in func curl_setup and this problem was fixed.

shouhulantian avatar Apr 20 '20 23:04 shouhulantian