Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6733769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:48:34+00:00 2026-05-26T10:48:34+00:00

Using Flask (0.8) and Werkzeug (0.8.1) when attempting to run code with app.run(debug=True) I

  • 0

Using Flask (0.8) and Werkzeug (0.8.1) when attempting to run code with app.run(debug=True) I get the below described error. There are no errors when using app.run()

The error

Traceback (most recent call last):
File "code2.py", line 9, in <module>
    app.run(debug=True)
File "/<snip>/env/lib/python2.7/site-packages/Flask-0.8-py2.7.egg/flask/app.py", line 703, in run
    run_simple(host, port, self, **options)
File "/<snip>/env/lib/python2.7/site-packages/Werkzeug-0.8.1-py2.7.egg/werkzeug/serving.py", line 587, in run_simple
    from werkzeug.debug import DebuggedApplication
File "/<snip>/env/lib/python2.7/site-packages/Werkzeug-0.8.1-py2.7.egg/werkzeug/debug/__init__.py", line 14, in <module>
    from werkzeug.debug.tbtools import get_current_traceback, render_console_html
File "/<snip>/env/lib/python2.7/site-packages/Werkzeug-0.8.1-py2.7.egg/werkzeug/debug/tbtools.py", line 19, in <module>
    from werkzeug.debug.console import Console
File "/<snip>/env/lib/python2.7/site-packages/Werkzeug-0.8.1-py2.7.egg/werkzeug/debug/console.py", line 144, in <module>
    class _InteractiveConsole(code.InteractiveInterpreter):
AttributeError: 'module' object has no attribute 'InteractiveInterpreter'

The code (code.py)

from flask import Flask
app = Flask(__name__)

@app.route('/news/')
def news():
    pass

if __name__ == '__main__':
    app.run(debug=True)

Steps taken to recreate the error

$ cd <project directory>
$ . env/bin/activate # Activates virtuanlenv environment (see below for packages)
$ python code.py

Contents of my env/lib/python2.7/site-packages (versions of various library used) via virtualenv

Flask-0.8-py2.7.egg
Jinja2-2.6-py2.7.egg
pip-1.0.2-py2.7.egg
setuptools-0.6c11-py2.7.egg
Werkzeug-0.8.1-py2.7.egg

Things I have tried to solve this problem so far, that have not helped (unfortunately)

  • Extensive googling/SO searching
  • Heavy simplification of my code
  • Deleting created virtualenv and all libraries and reinstallation via easy_install

The strange thing here is that last night, this code worked fine. This morning, without changing anything (that I’m aware of) the code failed to properly run.

Thanks very much for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:48:34+00:00Added an answer on May 26, 2026 at 10:48 am

    The problem is that you have named your module code.py. code is a built in Python module that werkzeug uses (https://docs.python.org/3/library/code.html).

    To fix the problem, rename your code.py to something else, and make sure you delete the code.pyc file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get strange errors when trying to deploy a Flask app (v0.8). I'm using
I am using Flask, WTForms, and the OurSQL MySQL library for my app. I
I am using Flask micro-framework 0.6 and Python 2.6 I need to get the
I am writing my website's backend using Flask and Python 2.7, and have run
I'm currently working on a project using Flask and Google App Engine . Calling
I'm using elixir/flask in a small web app I wrote for my own personal
I'm a Flask beginner and I want to build a poll app using flask
I am trying to get a simple image upload app working on Heroku using
I have been developing an app using the very easy-to-pickup Flask system and I
I am using the Flask micro-framework which is based on Werkzeug, which uses Python.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.