Why is it so problematic to add python modules and why are there so many missing?
Why is it so problematic to add python modules and why are there so many missing?
There are many articles, however none of them really help.
I am trying to run a simple little script as a test, however I'm getting the no module pycurl error
This is a basic module that many people would use, so why isn't it part of the system and why can't I get it installed?
My Code:
import http.client
import pycurl
#import cStringIO
import re
import urllib.error
import urllib.request
def test2():
curl = pycurl.Curl()
buff = cStringIO.StringIO()
hdr = cStringIO.StringIO()
curl.setopt(pycurl.URL, 'http://example.org')
curl.setopt(pycurl.WRITEFUNCTION, buff.write)
curl.setopt(pycurl.HEADERFUNCTION, hdr.write)
curl.perform()
print("status code: %s" % curl.getinfo(pycurl.HTTP_CODE))
# -> 200
status_line = hdr.getvalue().splitlines()[0]
m = re.match(r'HTTP\/\S*\s*\d+\s*(.*?)\s*$', status_line)
if m:
status_message = m.groups(1)
else:
status_message = ''
print("status message: %s" % status_message)
# -> "OK"
The Error: ModuleNotFoundError: No module named 'pycurl' 14:22:35 Normal 0.00