TAGS :Viewed: 12 - Published at: a few seconds ago

[ No module named 'flask' while using Vagrant ]

I am trying to setup Vagrant in my machine(ubuntu 15.10 64bit). and I followed the steps mentioned here link

I am getting error as no Flask found when I run app.py

Am i missing something here? Its mentioned that all packages from requirements will be installed automatically. But I am not able to make it work.

Steps are as follows:

Getting started

Install Vagrant

Clone this repo as your project name:

git clone git@github.com:paste/fvang.git NEW-PROJECT-NAME

Configure project name and host name in ansible/roles/common/vars/main.yml:

project_name: "fvang"
host_name: "fvang.local"

Modify your local /etc/hosts:

192.168.33.11   fvang.local

Build your Vagrant VM:

vagrant up

Log into the VM via SSH:

vagrant ssh

Start Flask development server:

cd ~/fvang
python app/app.py

Answer 1


I am the author of the FVANG repo, but I don't have the rep to join your chat. I posted a response on the github issue, see here: https://github.com/paste/fvang/issues/2

I think the Ansible provisioning script failed to complete due to changes in Ansible 2.0. (otherwise Flask would have been installed from requirements.txt). You can check which version of Ansible was installed by running ansible --version. I will be upgrading the scripts to 2.0 shortly.

Edit --

I just updated the repo to work with Ansible 2.0 and simplified a few things. Everything should work as expected now, give it a shot. You'll probably want to just vagrant destroy and vagrant up again.

Answer 2


A vagrant machine as new as a new operating system. You need to install each and every software you need. try this

sudo pip install Flask

After installation if you need to run the app, then you need to uncomment vagrant's ip (In Vagrantfile) before accessing vagrant's localhost, it turns out to be 192.168.33.10 generally and port 5000