Search code examples
pythonflaskpybuilder

PyBuilder won't install Flask?


So I was trying to setup pybuilder for my flask application and for some reason, it does not install dependencies? It shows this when I run 'pyb install_dependencies'

PyBuilder version 0.11.10
Build started at 2017-07-17 11:57:23
------------------------------------------------------------
[INFO]  Building flask-example version 0.1.2
[INFO]  Executing build in /home/aalred/flask-example
[INFO]  Going to execute task install_dependencies
[INFO]  Installing all dependencies
[INFO]  Processing batch dependency 'coverage'
[INFO]  Processing batch dependency 'pyassert'
[INFO]  Processing batch dependency 'pyfix'
[INFO]  Processing batch dependency 'flask'
------------------------------------------------------------
BUILD SUCCESSFUL
------------------------------------------------------------

But then when I do the command:

python hello.py

I get the following error:

    from flask import Flask, render_template
ImportError: No module named flask

Can someone please explain what is going on? This is confusing me quite a bit and I cannot seem to find a straightforward answer.

Here is my build.py if that helps too:

from pybuilder.core import init, use_plugin

use_plugin("python.core")
use_plugin("python.install_dependencies")
#use_plugin("python.unittest")

default_task = ['install_dependencies', 'publish']

@init
def initialize(project):
    project.build_depends_on('pyfix')
    project.build_depends_on('pyassert')
    project.depends_on('flask')
    project.depends_on('flask-mysql')

Solution

  • After some careful digging, I found out that the build.py I was running repeatedly had

    project.depends_on('flask')
    

    commented out. Silly me!