Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I highly doubt you've got a module called <code>ZipCodeDatabase</code>. That naming convention is typically reserved for a <code>class</code> that resides within a <code>module</code>. Modules are usually lowercase or lower_snake_case, to represent the file containing the module. I'm assuming you've installed <code>pyzipcode</code> here, but it may be a different module.</p> <pre><code># assuming pyzipcode.py in the dist-packages directory $ python -c 'from pyzipcode import ZipCodeDatabase' </code></pre> <p>If I'm wrong above, then are you <strong>sure</strong> you're running the version of python that has the ZipCodeDatabase module installed?</p> <p>Some troubleshooting steps:</p> <pre><code>$ which python $ python --version $ python -c 'import ZipCodeDatabase' $ ls -l /usr/local/lib/python2.7/dist-packages/ | grep -i zip </code></pre> <p>Also, is it really necessary for you to specify the <code>PYTHONPATH</code> line? Typically, the <code>site-packages</code> folder (and by extension I assume the <code>dist-packages</code> folder on Ubuntu) is included in the default <code>PYTHONPATH</code>, along with the current directory of the python module you're using.</p> <p>How did you install the ZipCodeDatabase? Did you just drop the file in there? Try putting it alongside your <code>helloworld.py</code> file and try importing it then. Also, a full stack trace is useful information here, especially when others are trying to diagnose the problem you're having.</p> <p>Edit:</p> <p>Ok, now that I know you're using google app engine (should have been obvious from your use of paths - I'm sorry), it looks like it doesn't use the <code>site-packages</code> or <code>dist-packages</code> to load modules. You should create a sub-directory in your project with the relevant third party libraries, and add that sub-directory to your path. <em>Disclaimer:</em> I've never used GAE so I might be missing the mark with this.</p> <p>Check out <a href="https://stackoverflow.com/a/2710892/10583">this answer</a> for how to structure your project and add the extra directory to your path from within the application.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload