I tried this minimal example:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run(debug = True)
When I try python hello.py
, everything goes well. However, when I try to run it from Textmate (Shift + Cmd + R) an error is thrown:
Traceback (most recent call last):
File "/Users/user/EventFeed/hello.py", line 1, in <module>
from flask import Flask
ImportError: No module named flask
Textmate calls pythonw
instead of python
. When I try pythonw
myself the same error is thrown.
The man pythonw
states that As of Python 2.5, python and pythonw are interchangeable though they appear not to be in this case.
Would you have an idea of what happens?
(Question Code that works with python and not with pythonw does not answer the question despite its similar title.)