title: ImportError: No module named twisted.internet
body: <p>I installed python 2.7.5 which is working fine.</p>
  
  <p>I then install scrapy (which, I think, uses twisted internally).  My scrapy spider is also working fine.</p>
  
  <p>I installed twisted:</p>
  
  <blockquote>
    <p>sudo apt-get install python-twisted</p>
  </blockquote>
  
  <p>Then, I created a sample program using Echo Server code shown <a href="http://twistedmatrix.com/trac/">here</a> </p>
  
  <p>Here is the code </p>
  
  <pre><code>from twisted.internet import protocol, reactor
  
  
  class Echo(protocol.Protocol):
      def dataReceived(self, data):
          self.transport.write(data)
  
  class EchoFactory(protocol.Factory):
      def buildProtocol(self, addr):
          return Echo()
  
  reactor.listenTCP(1234, EchoFactory())
  reactor.run()
  </code></pre>
  
  <p>I try to run this code using this command:</p>
  
  <pre><code>$ python twistedTester.py 
  Traceback (most recent call last):
    File "twistedTester.py", line 1, in &lt;module&gt;
      from twisted.internet import protocol, reactor
  ImportError: No module named twisted.internet
  </code></pre>
  
  <p>Can anyone help me with how I can debug why my twisted package is not being picked up by Python installation?</p>