Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xieexiaotuzi opened this issue Aug 27, 2019 · 10 comments
Open

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

xieexiaotuzi opened this issue Aug 27, 2019 · 10 comments
Assignees
Labels

Comments

@xieexiaotuzi
Copy link

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
Copy link
Author

@siznax

@siznax
Copy link
Owner

siznax commented Aug 29, 2019

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 siznax self-assigned this Aug 29, 2019
@siznax
Copy link
Owner

siznax commented Aug 29, 2019

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.

@lisongx
Copy link
Contributor

lisongx commented Aug 29, 2019

@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)

@JianyuZhao7
Copy link

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

@lisongx
Copy link
Contributor

lisongx commented Aug 30, 2019

@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

@naspuka
Copy link

naspuka commented Sep 12, 2019

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

@asifkhan69
Copy link

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.

@siznax
Copy link
Owner

siznax commented Oct 9, 2019

@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.

@shouhulantian
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants