Questions tagged [pycurl]

PycURL is a Python interface to libcurl.

PycURL is a Python interface to libcurl. PycURL can be used to fetch objects identified by a URL from a Python program, similar to the urllib Python module. PycURL is mature, very fast, and supports a lot of features.

567 questions
226
votes
12 answers

"Could not run curl-config: [Errno 2] No such file or directory" when installing pycurl

I'm trying to install pycurl via: sudo pip install pycurl It downloaded fine, but when when it runs setup.py I get the following traceback: Downloading/unpacking pycurl Running setup.py egg_info for package pycurl Traceback (most recent call…
user3688241
  • 2,395
  • 2
  • 11
  • 12
137
votes
7 answers

Why can't Python find shared objects that are in directories in sys.path?

I'm trying to import pycurl: $ python -c "import pycurl" Traceback (most recent call last): File "", line 1, in ImportError: libcurl.so.4: cannot open shared object file: No such file or directory Now, libcurl.so.4 is in…
user135171
117
votes
4 answers

Making an API call in Python with an API that requires a bearer token

Looking for some help with integrating a JSON API call into a Python program. I am looking to integrate the following API into a Python .py program to allow it to be called and the response to be printed. The API guidance states that a bearer token…
user4657
  • 1,333
  • 2
  • 11
  • 9
88
votes
26 answers

SSL backend error when using OpenSSL

I was trying to install pycurl in a virtualenv using pip and I got this error ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other) I read some documentation saying that "To fix this,…
helloworld2013
  • 2,923
  • 5
  • 16
  • 25
81
votes
7 answers

Execute curl command within a Python script

I am trying to execute a curl command within a python script. If I do it in the terminal, it looks like this: curl -X POST -d '{"nw_src": "10.0.0.1/32", "nw_dst": "10.0.0.2/32", "nw_proto": "ICMP", "actions": "ALLOW", "priority": "10"}'…
Kiran Vemuri
  • 1,763
  • 1
  • 17
  • 37
72
votes
8 answers

Which is best in Python: urllib2, PycURL or mechanize?

Ok so I need to download some web pages using Python and did a quick investigation of my options. Included with Python: urllib - seems to me that I should use urllib2 instead. urllib has no cookie support, HTTP/FTP/local files only (no SSL) urllib2…
bigredbob
  • 1,807
  • 4
  • 19
  • 19
53
votes
4 answers

Python Requests vs PyCurl Performance

How does the Requests library compare with the PyCurl performance wise? My understanding is that Requests is a python wrapper for urllib whereas PyCurl is a python wrapper for libcurl which is native, so PyCurl should get better performance, but…
Eugene
  • 9,015
  • 18
  • 58
  • 86
29
votes
2 answers

Convert io.BytesIO to io.StringIO to parse HTML page

I'm trying to parse a HTML page I retrieved through pyCurl but the pyCurl WRITEFUNCTION is returning the page as BYTES and not string, so I'm unable to Parse it using BeautifulSoup. Is there any way to convert io.BytesIO to io.StringIO? Or Is there…
Shipra
  • 1,049
  • 2
  • 11
  • 24
28
votes
2 answers

How do I get the IP address from a http request using the requests library?

I am making HTTP requests using the requests library in python, but I need the ip address from the server that responded the http request and I'm trying to avoid to make two calls (and possibly having a different ip address from the one that…
gawry
  • 643
  • 1
  • 8
  • 17
27
votes
3 answers

pycurl and SSL cert

I am trying to write a pycurl script to access a secured site (HTTPS). c = pycurl.Curl() c.setopt(pycurl.USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0') c.setopt(pycurl.URL,…
K2M
  • 379
  • 1
  • 5
  • 12
26
votes
7 answers

How can I install pyCurl?

I used libcurl with no problems and used pyCurl once in the past. Now i want to set it up on my machine and dev. However i have no idea how to do it. I rather not DL libcirl files and compile that along with pycurl, i want to know the simplest…
user34537
25
votes
4 answers

How to read the header with pycurl

How do I read the response headers returned from a PyCurl request?
sverrejoh
  • 15,235
  • 13
  • 37
  • 29
22
votes
3 answers

Custom headers with pycurl

Can I send a custom header like "yaddayadda" to the server with the pycurl request?
Pockata
  • 1,308
  • 2
  • 11
  • 13
22
votes
4 answers

How to get HTTP status message in (py)curl?

spending some time studying pycurl and libcurl documentation, i still can't find a (simple) way, how to get HTTP status message (reason-phrase) in pycurl. status code is easy: import pycurl import cStringIO curl = pycurl.Curl() buff =…
mykhal
  • 16,760
  • 11
  • 69
  • 76
18
votes
0 answers

Install pycurl on Mac OSX Snow Leopard

After hours of reading on the internet I found the easiest solution to install pycurl on mac os x. Make sure you have Xcode UNIX tool installed and run this command. sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl==7.16.2.1
Dragos C
  • 363
  • 3
  • 7
1
2 3
37 38