title: How do I distribute data files with a python package such that they're readable?
body: <p>I have a python module with a setup like this:</p>
  
  <pre><code>from distutils.core import setup
  setup = (
      ...
      package_data={'mypackage': ['my/file.data']})
  </code></pre>
  
  <p>in a package laid out like this:</p>
  
  <pre><code>mypackage/
      setup.py
      mypackage/
          __init__.py
          my/
              file.data
  </code></pre>
  
  <p>and <code>__init__.py</code> looks something like this:</p>
  
  <pre><code>import pkgutil
  DATA = pkgutil.get_data(__name__, 'my/file.data')
  </code></pre>
  
  <p>Pretty simple. All I want is to get some data into my python plugin. However, when I install it with</p>
  
  <pre><code>sudo python setup.py install
  </code></pre>
  
  <p>and try to run it, I get</p>
  
  <pre><code>IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/mypackage/my/file.data'
  </code></pre>
  
  <p>It's been installed with incorrect permissions.</p>
  
  <p>How do I distribute data and config files in python such that they can be read at runtime?</p>