<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">According to this <a href="https://github.com/pallets/flask/blob/master/examples/flaskr/README">README</a> the Flaskr example application should run after doing following:</p>
<p dir="auto"><code class="notranslate">pip install --editable .</code><br>
<code class="notranslate">export FLASK_APP=flaskr.factory:create_app()</code><br>
<code class="notranslate">flask initdb</code><br>
<code class="notranslate">flask run</code></p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Flaskr fails running throwing a NoAppException.</p>
<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="NoAppException: The file/path provided (flaskr.factory) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py"><pre class="notranslate"><span class="pl-en">NoAppException</span>: <span class="pl-s">The file/path provided (flaskr.factory) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py</span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Python version: 2.7</li>
<li>Flask version: 0.12.2</li>
<li>Werkzeug version: 0.12.2</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">The flaskr example code (in examples/flaskr) should work off-the-shelf. But I was able to reproduce the following issue by forking a clean copy of the repository and following the instructions in the README.md of the flaskr example. Namely, these are the commands I'm executing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ git clone https://github.com/alexander-jiang/flask.git
$ cd flask/examples/flaskr
$ virtualenv venv
$ venv\Scripts\activate
$ pip install -e .
$ set FLASK_APP=flaskr.factory:create_app()
$ flask initdb
$ flask run"><pre class="notranslate"><code class="notranslate">$ git clone https://github.com/alexander-jiang/flask.git
$ cd flask/examples/flaskr
$ virtualenv venv
$ venv\Scripts\activate
$ pip install -e .
$ set FLASK_APP=flaskr.factory:create_app()
$ flask initdb
$ flask run
</code></pre></div>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">The <code class="notranslate">flask initdb</code> command fails with a <code class="notranslate">RuntimeError</code>:</p>
<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;c:\users\xxxxxxxxx\appdata\local\programs\python\python36-32\Lib\runpy.py&quot;, line 193, in _run_module_as_main
    &quot;__main__&quot;, mod_spec)
  File &quot;c:\users\xxxxxxxxx\appdata\local\programs\python\python36-32\Lib\runpy.py&quot;, line 85, in _run_code
    exec(code, run_globals)
  File &quot;C:\Users\xxxxxxxxx\flask\examples\flaskr\venv\Scripts\flask.exe\__main__.py&quot;, line 9, in &lt;module&gt;
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py&quot;, line 513, in main
    cli.main(args=args, prog_name=name)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py&quot;, line 380, in main
    return AppGroup.main(self, *args, **kwargs)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py&quot;, line 697, in main
    rv = self.invoke(ctx)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py&quot;, line 1061, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py&quot;, line 1100, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py&quot;, line 351, in get_command
    rv = info.load_app().cli.get_command(ctx, name)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py&quot;, line 237, in load_app
    rv = locate_app(self.app_import_path)
  File &quot;c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py&quot;, line 109, in locate_app
    % module)
RuntimeError: Failed to find application in module &quot;flaskr.factory&quot;"><pre class="notranslate">Traceback (most recent call last):
  File <span class="pl-s">"c:\users\xxxxxxxxx\appdata\local\programs\python\python36-32\Lib\runpy.py"</span>, line <span class="pl-c1">193</span>, in <span class="pl-en">_run_module_as_main</span>
    <span class="pl-s"><span class="pl-pds">"</span>__main__<span class="pl-pds">"</span></span>, mod_spec)
  File <span class="pl-s">"c:\users\xxxxxxxxx\appdata\local\programs\python\python36-32\Lib\runpy.py"</span>, line <span class="pl-c1">85</span>, in <span class="pl-en">_run_code</span>
    <span class="pl-c1">exec</span>(code, run_globals)
  File <span class="pl-s">"C:\Users\xxxxxxxxx\flask\examples\flaskr\venv\Scripts\flask.exe\__main__.py"</span>, line <span class="pl-c1">9</span>, in <span class="pl-en">&lt;module&gt;</span>
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py"</span>, line <span class="pl-c1">513</span>, in <span class="pl-en">main</span>
    cli.main(<span class="pl-v">args</span><span class="pl-k">=</span>args, <span class="pl-v">prog_name</span><span class="pl-k">=</span>name)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py"</span>, line <span class="pl-c1">380</span>, in <span class="pl-en">main</span>
    <span class="pl-k">return</span> AppGroup.main(<span class="pl-c1">self</span>, <span class="pl-k">*</span>args, <span class="pl-k">**</span>kwargs)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py"</span>, line <span class="pl-c1">697</span>, in <span class="pl-en">main</span>
    rv <span class="pl-k">=</span> <span class="pl-c1">self</span>.invoke(ctx)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py"</span>, line <span class="pl-c1">1061</span>, in <span class="pl-en">invoke</span>
    cmd_name, cmd, args <span class="pl-k">=</span> <span class="pl-c1">self</span>.resolve_command(ctx, args)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\click\core.py"</span>, line <span class="pl-c1">1100</span>, in <span class="pl-en">resolve_command</span>
    cmd <span class="pl-k">=</span> <span class="pl-c1">self</span>.get_command(ctx, cmd_name)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py"</span>, line <span class="pl-c1">351</span>, in <span class="pl-en">get_command</span>
    rv <span class="pl-k">=</span> info.load_app().cli.get_command(ctx, name)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py"</span>, line <span class="pl-c1">237</span>, in <span class="pl-en">load_app</span>
    rv <span class="pl-k">=</span> locate_app(<span class="pl-c1">self</span>.app_import_path)
  File <span class="pl-s">"c:\users\xxxxxxxxx\flask\examples\flaskr\venv\lib\site-packages\flask\cli.py"</span>, line <span class="pl-c1">109</span>, in <span class="pl-en">locate_app</span>
    <span class="pl-k">%</span> module)
<span class="pl-en">RuntimeError</span>: <span class="pl-s">Failed to find application in module "flaskr.factory"</span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>OS: Windows 10 (64 bit)</li>
<li>Python version: 3.6.1</li>
<li>Flask version: 0.12.2</li>
<li>Werkzeug version: 0.12.2</li>
</ul>