title: PyAudio cannot find any output devices
body: <p>When I run:</p>
  
  <pre><code>import pyaudio
  pa = pyaudio.PyAudio()
  pa.get_default_output_device_info()
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>IOError: No Default Output Device Available
  </code></pre>
  
  <p>When I say:</p>
  
  <pre><code>pa.get_device_count()
  </code></pre>
  
  <p>It returns <code>0L</code>.</p>
  
  <p>And of course if I list devices</p>
  
  <pre><code>for i in range(0, device_count):
          print("Name: " + pa.get_device_info_by_index(i)["name"])
          print("Index: " + pa.get_device_info_by_index(i)["index"])
          print("\n")
  </code></pre>
  
  <p>It will not print anything.</p>
  
  <p>I'm running Ubuntu 16.04 and have set my default sink by going:</p>
  
  <pre><code>pacmd list-sinks
  pacmd set-default-sink 0
  </code></pre>
  
  <p>I have the latest versions of PulseAudio, ALSA, and PortAudio. Any suggestions?</p>
  
  <p>Update: I also can't view any sound devices on Audacity, despite the fact that they appear under System Settings>Sound. In Audacity I get the error:</p>
  
  <blockquote>
    <p>Error while opening sound device. Please check the recording device
    settings and the project sample rate.</p>
  </blockquote>
  
  <p>I think that this is almost certainly a PortAudio issue since the settings page looks like:
  <a href="https://i.stack.imgur.com/X2VMs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X2VMs.png" alt="enter image description here"></a></p>