Make sure you have python 3 installed. I recommend using miniconda to install python 3.
You will need two packages: librosa and numpy
You can install these by running with
pip install numpy librosa
Two biggest issues are that comparing the program's loudness and segment calculations to Spotify's, there is too much of a difference. To see their segment values for a song go here and search for segments at the bottom. To see their loudness and energy values for a song go here.
Another issue I can think of: I used average segment duration.
This post by an Echo Nest engineer stated that the method they use to dertermine energy includes loudness and segment duration.
So including segment durations in some other way than getting their mean might improve scores.
Read the paper I wrote for an overview of the algorithms I used and some more background info on energy and Spotify's other algorithms.