pycurl

problem sending an HTTPGET with PyCurl

青春壹個敷衍的年華 提交于 2019-12-11 23:43:00
问题 I am having problems converting the following curl command into PyCurl: curl -k --cert /tmp/blablabla "https://blablabla" My attempt so far is shown below: c = pycurl.Curl() c.setopt(pycurl.URL, submit_url) c.setopt(pycurl.HTTPGET, 1) b = StringIO.StringIO() c.setopt(pycurl.WRITEFUNCTION, b.write) c.setopt(pycurl.FOLLOWLOCATION, 1) c.setopt(pycurl.MAXREDIRS, 5) c.setopt(pycurl.SSLCERT, cert) c.setopt(pycurl.CAPATH,'/bla/bla/bla') c.perform() c.close() This does not work. If anyone could tell

Python pip install failing with error code 1

▼魔方 西西 提交于 2019-12-11 19:29:27
问题 I am working on CentOS6 and have been able to install python2.7. After creating a virtualenv I have started installing various packages of python. I can install some packages easily like requests,etc. but installing packages like Numpy, scipy, gensim, pycurl are a huge pain. It keeps on giving me this error: By running pip install pycurl from within the virtualenv with python2.7 installed I am running into the problem. Collecting pycurl Downloading pycurl-7.19.5.1.tar.gz (142kB) 100% |███████

PyCurl request hangs infinitely on perform

[亡魂溺海] 提交于 2019-12-11 06:13:34
问题 I have written a script to fetch scan results from Qualys to be run each week for the purpose of metrics gathering. The first part of this script involves fetching a list of references for each of the scans that were run in the past week for further processing. The problem is that, while this will work perfectly sometimes, other times the script will hang on the c.perform() line. This is manageable when running the script manually as it can just be re-run until it works. However, I am looking

how to use pycurl if requested data is sometimes gzipped, sometimes not?

守給你的承諾、 提交于 2019-12-11 02:52:43
问题 I'm doing this to fetch some data: c = pycurl.Curl() c.setopt(pycurl.ENCODING, 'gzip') c.setopt(pycurl.URL, url) c.setopt(pycurl.TIMEOUT, 10) c.setopt(pycurl.FOLLOWLOCATION, True) xml = StringIO() c.setopt(pycurl.WRITEFUNCTION, xml.write ) c.perform() c.close() My urls are typically of this sort: http://host/path/to/resource-foo.xml Usually I get back 302 pointing to: http://archive-host/path/to/resource-foo.xml.gz Given that I have set FOLLOWLOCATION, and ENCODING gzip, everything works

ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)

匆匆过客 提交于 2019-12-10 11:37:55
问题 I wanted to run python file. But I could check this error when I ran it. ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other) My system is Mac os 10.13.2 and I used python 2.7 回答1: Looks like something went wrong with pycurl/openssl, try this: pip uninstall pycurl pip install --compile --install-option="--with-openssl" pycurl if still fails, try this as well brew reinstall openssl 回答2: Reinstall the curl libraries brew install

MAC OS ImportError: pycurl: libcurl link-time version (7.37.1) is older than compile-time version (7.43.0)

六眼飞鱼酱① 提交于 2019-12-10 09:44:27
问题 when i import curl in python interface,it displayed the error ImportError: pycurl: libcurl link-time version (7.37.1) is older than compile-time version (7.43.0). how to solve it ? my system is yosemite. 回答1: I met this error on Sierra. Thanks to seeliuh's post in this issue, I fixed it after doing: 1.uninstall pycurl. pip uninstall pycurl 2.export LD_LIBRARY_PATH= <<your homebrew's libcurl path>> export LD_LIBRARY_PATH=/usr/local/opt/curl/lib export LIBRARY_PATH=/usr/local/opt/curl/lib 3

How to install libcurl with nss backend in aws ec2? (Python 3.6 64bit Amazon Linux)

梦想的初衷 提交于 2019-12-09 18:49:35
问题 I have an ec2 instance in AWS running Python3.6 (Amazon Linux/2.8.3) where I need to install pycurl with NSS ssl backend . First I tried it by adding pycurl==7.43.0 --global-option="--with-nss" to my requirement.txt file but I was getting errors installation errors. So I ended up doing it by adding a .config file in .ebextensions (that runs during deployment): container_commands: 09_pycurl_reinstall: # the upgrade option is because it will run after PIP installs the requirements.txt file. #

Can't install pycurl with pip

喜欢而已 提交于 2019-12-08 16:12:02
问题 Can't install pycurl with pip, win xp x32, python 2.7. here is the log pip install pycurl Downloading/unpacking pycurl Downloading pycurl-7.19.3.1.tar.gz (116Kb): 116Kb downloaded Running setup.py egg_info for package pycurl Please specify --curl-dir=/path/to/built/libcurl Complete output from command python setup.py egg_info: Please specify --curl-dir=/path/to/built/libcurl ---------------------------------------- Command python setup.py egg_info failed with error code 10 in C:\Documents and

Uploading files from a Cyrillic path using pycurl

╄→尐↘猪︶ㄣ 提交于 2019-12-08 05:13:10
问题 I've recently designed an upload dialog backed by PyCURL which I'm using in a few of my applications. I have run into an issue when setting pycurl's HTTPPOST option. I am setting it like so: self.curl.setopt(self.curl.HTTPPOST, [(field, (self.curl.FORM_FILE, filename))]) If filename is a string, all is fine. If I pass it a unicode, however, it raises a TypeError. Is there any way for me to be able to give it a Cyrillic path? I tried UTF-8 encoding it, but that was unsuccessful. Thank you for

Automate interaction with a webpage in python [closed]

谁都会走 提交于 2019-12-07 09:30:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I want to automate interaction with a webpage. I've been using pycurl up til now but eventually the webpage will use javascript so I'm looking for alternatives . A typical interaction is "open the page, search for some text, click on a link (which opens a form), fill out the form and submit". We're deploying on