title: importError: No module named pycurl
body: <p>I'm following this guide - <a href="http://videos.cctvcamerapros.com/digital-io-alarm-in-out/send-push-notifications-from-raspberry-pi.html" rel="nofollow">http://videos.cctvcamerapros.com/digital-io-alarm-in-out/send-push-notifications-from-raspberry-pi.html</a></p>
  
  <p>I've installed pycurl using sudo apt-get install python-pycurl but when i run the code it simply shows:</p>
  
  <pre><code>Traceback (most recent call last): File "/home/pi/desktop/doorsensor.py", line 1, in &lt;module&gt; import pycurl, json importError: No module named pycurl
  </code></pre>
  
  <p>Can anyone help?</p>
  
  <p>Here is my code </p>
  
  <pre><code>import pycurl, json
  from StringIO import StringIO
  import RPi.GPIO as GPIO
  GPIO.setmode(GPIO.BCM)
  GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  appID = "56cbc8e95659e3f40dc56c64"
  appSecret = "a8c3c0302545ad64f71f7aa5f10e52ef"
  pushEvent = "DoorAlert"
  pushMessage = "Door Opened!"
  buffer = StringIO()
  c = pycurl.Curl()
  c.setopt(c.URL, 'https:api.instapush.im/v1/post')
  c.seopt(c.HTTPHEADER, ['x-instapush-appid: ' + appID,
                     'x-instapush-appsecret: ' + appSecret,
                     'Content-Type: application/json'])
  json_fields = {}
  json_fields['event']=pushEvent
  json_fields['trackers'] = {}
  json_fields['trackers']['message']=pushMessage
  postfields = json.dumps(json_fields)
  c.setopt(c.POSTFIELDS, postfields)
  c.setopt(c.WRITEFUNCTION, buffer.write)
  c.setopt(c.VERBOSE, True)
  while True:
  GPIO.wait_for_edge(23, GPIO.RISING)
  print("Door Opened!\n")
  c.perform()
  body= buffer.getvalue()
  print(body)
  buffer.turncate(0)
  buffer.seek(0)
  GPIO.wait_for_edge(23, GPIO.FALLING)
  print("Door Closed!\n")
  c.close()
  GPIO.cleanup()
  </code></pre>
  
  <p>Ok so I ran in it Python v2.7. and it works.
  But now I'm getting </p>
  
  <pre><code>traceback (most recent call last):
    File "/home/pi/Desktop/doorSensor.py", line 5, in &lt;module&gt;
      GPIO.setup(26, GPIO.IN, pull_up_down=GPIO.PUD_UP)
  RuntimeError: No access to /dev/mem. Try running as root!
  </code></pre>