I’ve been keeping an eye on HTPC Manager (htpc.io) for a while, and decided that it was time to give it a try. One new VM install later (I need to update my images) and I was ready to start, but the big green download button was too simple to be true.
root@mediaManager:~# unzip -bash: unzip: command not found root@mediaManager:~#
The first hurdle, rather easy to solve
root@mediaManager:~# aptitude install unzip
But alas, it was too simple
root@mediaManager:~# ls HTPC-Manager-master master.zip root@mediaManager:~# cd HTPC-Manager-master/ root@mediaManager:~/HTPC-Manager-master# ls htpc HTPC-Manager.bat Htpc.py initd interfaces libs modules README.md root@mediaManager:~/HTPC-Manager-master# nano README.md root@mediaManager:~/HTPC-Manager-master# python Htpc.py <code></code>Traceback (most recent call last): File "Htpc.py", line 148, in main() File "Htpc.py", line 75, in main args = parse_arguments() File "Htpc.py", line 15, in parse_arguments import argparse ImportError: No module named argparse root@mediaManager:~/HTPC-Manager-master#
A quick glance back at the website confirmed that there were a few dependencies to install, namely PIL and it’s requirements. The site listed example commands, but they needed a little updating for Debian. I ended up using
aptitude install libjpeg62 libjpeg62-dev libpng12-dev libfreetype6 libfreetype6-dev zlib1g-dev python-pip
which got all the dependencies and PIP installed.
EDIT: I’ve since been informed by Styxit that PIL is recommended, not required.
The next step was to install the PIL using PIP, which should have been as simple as
pip install PIL
but even that was too simple. I was met with a couple of pages of compile errors, ranging from WARNING: ” not a valid package name; please use only.-separated package names in setup.py to _imaging.c:3152: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘functions’
My first thought was that I needed to install G++, ld, and everything else required to compile C extensions. Debian makes this nice and easy, with a meta-package that has everything as dependencies (It’s called build-essential), but installing it made no difference to the torrent of errors.
Wait, Debian loves to make stuff easy. Let’s see if there’s a pre-compiled .deb of the extension on any of the repos, however a quick aptitude install python-pi puts an end to that idea. My next step was to try and update PIP to the latest version. Linux software loves updating itself while running, and PIP is no different. pip install –upgrade pip is the command required, but that borks up everything
root@mediaManager:~/HTPC-Manager-master# pip install PIL Traceback (most recent call last): File "/usr/bin/pip", line 8, in from pip.baseparser import parser ImportError: cannot import name parser root@mediaManager:~/HTPC-Manager-master#
So maybe that was a bit too simple. A quick Google brings up the site of Andrea Grandi, who was having the same issue after self-updating PIP. He quite helpfully includes a translation of the fix from blog.102web.ru. For reference, it is as follows:
easy_install pip rm /usr/bin/pip ln -sv /usr/local/bin/pip-2.6 /usr/bin/pip pip install pip --upgrade
Essentially this removes PIP and then re-installs it using the old python library tool, easy_install. After this, PIP’s self-update procedure works fine, but I’m still stuck at the list of compile errors from PIP.
So what else needs to be installed to compile python libraries? *facepalm* the python dependencies!. A quick search in aptitude and (amongst the 1276 other packages) lies python-dev.
A short aptitude install
later, and PIP gives me a nice Successfully installed PIL
message.
Python 0-1 Jacob
Or not, I’m still getting the argparse error message. Could this be as easy as pip install argparse ?
Turns out it is, after a few seconds of install, Htpc.py starts up fine and I’m ready to point it to my servers
My gosh, that was a painful install! I’m glad I found your blog..I was running out of ideas.
pip install argparse was what I needed!