It looks like your pycurl installation (or curl library) is somehow corrupted. From the curl error code documentation:
CURLE_FAILED_INIT (2)
Very early initialization code failed. This is likely to be an internal error or problem.
You may need to reinstall or recompile curl or pycurl.
However, to make a simple POST request, as you do, you can use python "urllib" instead of CURL:
import urllib
postdata = urllib.urlencode(data)
resp = urllib.urlopen('https://www.sandbox.paypal.com/cgi-bin/webscr', data=postdata)
output = resp.read()
print resp.code
http_message = resp.info()
print http_message['content-length']
print http_message.type
print http_message.typeheader
resp.close()
URL https://, PyOpenSSL:
http://pypi.python.org/pypi/pyOpenSSL
, .
: pycurl.global_init()? - urllib/urllib2, , script .