caravel on windows 7

Today I am happy to see Caravel (https://github.com/airbnb/caravel) – a data exploration tool from Airbnb. So i am eager to try it.

First, I installed it on Ubuntu 15, which was “normal”  and work okay. However, I also use Windows 7 as one of my major working environment and it is not convenient to restart/switch OS in a single command without losing all workspace. So let’s make a try of caravel  on Windows 7.

On their installation instruction for windows, I copied for you to easy to see

# http://airbnb.io/caravel/installation.html
C:\> \path\to\vcvarsall.bat x86_amd64
C:\> set LIB=C:\OpenSSL-1.0.1f-64bit\lib;%LIB%
C:\> set INCLUDE=C:\OpenSSL-1.0.1f-64bit\include;%INCLUDE%
C:\> pip install cryptography

# You may also have to create C:\Temp
C:\> md C:\Temp
 Okay, for a toy playing, I do not need openssl and cryptography so I skip them.
I make a new virtualenv
virtualenv penv

I follow the instruction in the same page like this:
# Install caravel
pip install caravel

# Create an admin user
fabmanager create-admin --app caravel (1)

# Initialize the database
caravel db upgrade (2)

# Create default roles and permissions
caravel init (3)

# Load some data to play with
caravel load_examples

# Start the development web server
caravel runserver -d

From this one  (2), there is problem, saying that sqlite cannot find the database. Ah ha, now it is the geeky time.

Luckily, I found this file (https://github.com/airbnb/caravel/blob/master/caravel/config.py), this is the happy part: 🙂

Screenshot_2016-04-12_16-19-31

The sample database caravel.db, which is located at /tmp/caravel.db, on windows, there is no such path. This made the error about not found database. I knew caravel use SQLAlchemy by looking at carevel installation output and from the error lines, this leads me to this page http://flask-sqlalchemy.pocoo.org/2.1/config/ (Caravel uses flask – or more precisely they use flask-appbuilder).

sqlite:////absolute/path/to/foo.db
So I simply create a folder, I re-use c:\tmp – saving time, i know i am lazy. and
convert the line 36 above to:

 

SQLALCHEMY_DATABASE_URI = sqlite:///c:\\tmp\\caravel.db
 Remember, there are 3 back lashes and \\ for windows.

So now it works like a charm. Viola! congratuation.

 

Advertisements

One thought on “caravel on windows 7

  1. Thank you for your write up. I’ve been stuck on the db upgrade for a while. I appreciate the clear write up. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s