Skip to content

Instantly share code, notes, and snippets.

@puntonim
Created March 24, 2014 18:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save puntonim/9746746 to your computer and use it in GitHub Desktop.
Save puntonim/9746746 to your computer and use it in GitHub Desktop.
Bookie: setup a Mac OSX local dev environment

Bookie: setup a Mac OSX local dev environment

I succesfully managed to setup a local development environment for Bookie in my Mac OSX machine and I'd like to share a few notes. The required changes are just small details and I guess it would be easy to edit the Makefile in order to make it work with Mac OSX, but actually I'm not an expert on it...

System configuration

OS: Mac OSX 10.8.5
Xcode: 4.6.3

Steps

  1. Manually install system libraries
    build-essential libxslt1-dev libxml2-dev python-dev libpq-dev git python-virtualenv redis-server unzip
    I didn't have to install anything, most probably because many of these libraries are included in Xcode.
    In case, I suggest to use Homebrew and install libraries with a command like: brew install <lib-name>
    You can choose to install Redis in the same machine (with Mac OSX) or in a remote machine (in this case skip the library redis-server): I chose a remote Ubuntu machine.

  2. Create a folder and clone the code
    $ mkdir bookie && cd bookie
    $ git clone https://github.com/<my-username>/Bookie.git .

  3. Pyinotify and Redis
    Pyinotify uses inotify which works only on Linux machine, so we need to comment it out from requirements.txt:
    #pyinotify==0.9.4
    In case you use Redis in a remote machine, edit sample.ini:
    celery_broker=redis://<ip-address>:6379/3
    Also, make sure that $ python2 runs python2.7.x

  4. Install the app
    $ make install
    At a certain point, while running $ bin/python bin/alembic upgrade head it will fail, saying: from bookie.models import Base
    I have no idea why this happens, since actually if you run the python interpreter in the virtualenv you can correctly import Base.
    So just run it again: $ make install and this time it will work... this is not a good solution, of course, but I couldn't figure out a better solution.

  5. Run the app
    $ make run
    Or if you want to run Celery and and Pyramid in 2 different shells: $ bin/python bin/celery worker --app=bookie.bcelery -B -l debug --purge -c 1 --pidfile celeryd.pid
    $ bin/python bin/pserve --reload bookie.ini

Notes

@wellphd
Copy link

wellphd commented Jul 16, 2014

Thanks for posting this solution. I'm trying to install on OSX 10.9.4, python 2.7.5 and ending up with an error: /bookie/Bookie/build/lxml/src/lxml/includes/etree_defs.h:9:10: fatal error: 'libxml/xmlversion.h' file not found
I'll keep digging, do you have any ideas besides the obvious? Thanks in advance.

@ygreq
Copy link

ygreq commented Feb 2, 2017

A tutorial for non-tehcie guys would be very appreciated. I am stuck at Manually install system libraries
build-essential libxslt1-dev libxml2-dev python-dev libpq-dev git python-virtualenv redis-server unzip

I installed Homebrew by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment