title: Unable to use Stem and Tor in Python to change my IP address?
body: <p>I am currently trying to follow the a script I found online here: <a href="https://codeburst.io/anonymous-web-crawling-in-10-minutes-edff782decdc" rel="nofollow noreferrer">Periodic Tor IP Rotation</a></p>
  
  <p>The code I am trying to use is the following:</p>
  
  <pre><code>import requests
  from stem import Signal
  from stem.control import Controller
  with Controller.from_port(port = 9051) as controller:
    controller.authenticate()
    controller.signal(Signal.NEWNYM)
  proxies = {
    "http": "http://127.0.0.1:8118"
  }
  headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11'
  }
  r = requests.get("http://icanhazip.com", proxies=proxies, headers=headers)
  print(r.text)
  </code></pre>
  
  <p>However, my ip address doesn't change using this. Does anyone have any idea how I can modify it? Thanks.</p>