Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

pydev fails to accomodate bottle framework

Scott Cote
2012-09-05
2013-03-15
  • Scott Cote
    Scott Cote
    2012-09-05

    I am unsuccessful  in my effort to make an extremely simple example of the bottle framework work within PyDev, but I am able to make the same example, same file, operate correctly from the python shell interpreter (launched from a terminal command line).

    Here is the sample:

    from bottle import route, run

    @route('/hello/<name>')
    def index(name):
        return '<b>Hello %s!</b>' % name
    
    if __name__ == '__main__':
        run(host='localhost', port=8080)
    

    Inside PyDev, the line "from bottle import route, run" shows the object "route" underlined in red.  Hovering over the underlined item shows the tip, "unresolved import: route", but the other object, "run," is normal.  I am able to place the cursor into the text "run", then press the "f3" key, and drill into the "run" function of the "bottle" module.   Also, I can see the "bottle" module listed in the PyDev Package Explorer view.

    Environment Information is:
    1. Eclipse Platform - 3.7.2.v20120207-1839-9gF7UHPDFxGjd-PqDr2jX_4yKaumkoHTz04_q-q
    2. IDE Vendor - Spring Source Tool Suite - 2.9.1.RELEASE
    3. PyDev Eclipse Plugin - 2.6.0.2012062818
    4. Bottle Python Package/Egg - bottle-0.10.11-py2.7.egg
    5. OS - Mac OS X Lion

    Going into the preferences and remove/add the interpreter does not change the outcome.
    Changing the bottle installation method from easy_install to pip does not change the outcome.

    Otherwise, have had a great time using the plugin.

    What do I need to do in order for this to work?

    Regards,

    SCott