pythoneclipsepydev

How to make eclipse/pydev happy to see flask extensions on windows?


I stumbled upon this article and followed all steps. But pyDev won't see my flask extensions and that's really annoying. There's only one thing (and I think this is the key):

Touch /site-packages/flaskext/__init__.py

Touch is a unix util I think. Is there an equivalent to this on Windows?


Solution

  • The Eclipse uses static analysis of modules by default. flask.ext builds import list dynamically. To force dynamic analysis using Python shell add flask.ext to forced builtins list.

    Go to Preferences -> PyDev -> Interpreters -> Python Interpreter. Select your interpreter, go to Forced Builtins tab. Click New... and enter flask.ext.

    This requires PyDev to forcefully analyze module through a shell.

    For more details see PyDev manual.