Python error:curl: (1) Protocol "' https" not supported or disabled in Libcurl

Source: Internet
Author: User

When Python calls curl to access a webpage, it appears error:curl: (1) Protocol "' https" not supported or disabled in Libcurl

Console Direct Curl xxx is OK

Output = Subprocess.check_output (["Curl", "https://stackoverflow.com/questions/6884669/ Curl-1-protocol-https-not-supported-or-disabled-in-libcurl "]) # Errorprint (Output)

There is a solution, but this does not solve the problem, the original is a double quotation mark problem, replaced by quotation marks to solve the problem, always thought that but the quotation marks can represent the string, the specific why is not very clear, but to solve the problem, need to go deeper to understand, if you know please tell me the next

Output = Subprocess.check_output (["Curl", ' https://stackoverflow.com/questions/6884669/ Curl-1-protocol-https-not-supported-or-disabled-in-libcurl ']) # okprint (Output)

See demo is also single quote, curl supports but quotation marks? Tested the following pycurl are supported but quotation marks are the same

Import PYCURLC = Pycurl. Curl () c.setopt (C.url, ' https://www.taobao.com ') c.perform ()

Also the error:

Possible other reasons:

1, Curl does not support HTTPS can be viewed with curl-v

The workaround is to reinstall Curl for reference: http://www.codeweblog.com/curl%e4%b8%8d%e6%94%af%e6%8c%81https%e5%8d%8f%e8%ae%ae%e9%97%ae% e9%a2%98%e8%a7%a3%e5%86%b3/

wget HTTP://ARCHIVE.UBUNTU.COM/UBUNTU/POOL/MAIN/C/CURL/CURL_7.35.0.ORIG.TAR.GZTAR-XZVF CURL_7.35.0.ORIG.TAR.GZCD Curl_7.35.0.orig./configuremakesudo make Install

2, there is a space in quotation marks "https"

Python error:curl: (1) Protocol "' https" not supported or disabled in Libcurl

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.