Categories
Python

Fixing lxml installation on OS X

I have recently upgraded to OS X Yosemite. And somehow my lxml installation broke. When I tried to do pip install lxml, I was getting an error: ‘libxml/xmlversion.h’ file not found. The error message is obvious. While trying to compile lxml, it can’t find the libxml header files. What was not very obvious to me is how to fix this. I am using Homebrew. I upgraded both libxml2 and libxslt. Didn’t work. After quite some googling and checking out some stack overflow answers, I found out my mistake. By default, brew wouldn’t link the libxml and libxslt to avoid conflicts. So I have to force them. In short, this is what I needed to do:

Of course, if you didn’t have them installed before, you need to install them first:

If it doesn’t work even after force linking, you may want to first unlink previous versions.

Then I tried to install lxml from pip and it worked like a charm! 🙂

Categories
Javascript

ES6 on Node.js (And Heroku)

I will get straight to the point. ES6 is awesome and we want to use it in our Node.js project. We would use Babel to convert ES6 codes to ES5 compatible Javascript for Node. We first install Babel.

Now we write our awesome app in ES6:

We could use Babel to transpile ES6 to ES5 and then run the ES5 code in Node. But instead we shall directly run ES6 with the “babel-node” binary. The babel-node binary transpiles ES6 code in runtime. So we don’t need any watchers or manual transpilation.

We modify our package.json’s script’s section to add the babel-node binary:

Now if we push to Heroku, it will work fine 🙂

Categories
Bangla Screencast Series

Django Life – Session 3

The Video is available in HD