I was using the PhantomJS buildpack.
However, that mean heroku was no longer detecting the python buildpack and thus not importing beautifulsoup.
To fix the problem, I exected this command in terminal
heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
Then I created a text file called ".buildpack" , include the dot at the beginning. I then pasted these two urls in the text file
https://github.com/heroku/heroku-buildpack-python
https://github.com/stomita/heroku-buildpack-phantomjs
This tell it to use the python buildpack and the phantomJS buildpack.