Installing HTPC Manager can be really easy but might also cause some problems. The main requirement is you run Python. Python 2.7 is in most cases the way to go. The difficult part is installing the Python Image Library.
Python Image Library
The Python Image Library or PIL, is used to convert and resize images retrieved from the Xbmc Api. Installing PIL is, depending on your OS, not so easy. This guide should help you with it. If you do not use Xbmc or do not want the images, you can skip the installation of PIL and you only need Python.
OS specific guides
From the commandline you can run HTPC Manager with a few options to configure it’s behavior.
Parameter | Description | Default value ——— | ———————————- | ——– debug | Run in debug mode | none daemon | Daemonize process | none port | Listen on specific port | 8085 db | Use a custom database | none datadir | Set the datarirectory | none host | Use a specific host/IP | None/any pid | Location to generate pid file | false webdir | Mount HTPC Manager on a custom url | /
Combine any of the options on the commandline
python Htpc.py --debug --port 8089
By default, Osx comes with Python 2.7 pre-installed. Great! No need to install Pyton manually! If you want, you can already start using HTPC Manager.
Python Image library
The Python Image Library needs to be installed on your system to convert images provided by xbmc. To do this, the commandline tools from Xcode are needed to compile PIL.
Install Xcode from the AppStore
From Xcode, install commandline tools.
Xcode -> preferences -> Download -> install commandline tools
Install macports jpeg and png support.
Download and install the Mac Ports combo installer. This is used to enable jpeg and png support for PIL.
Open up the Terminal to install and compile PIL.
sudo easy_install pip sudo pip install PIL
You should now be ready to go. Take a look at the usage to get you started.
Installing Python on windows requires multiple steps, follow them carefully and you should be ok. Depending on your system you can use python 32 or 64 bits.
Download Python 2.7 from python.org
Depending on your version of Windowns you can choose the
Python 2.7.5 Windows Installeror the
Python 2.7.5 Windows X86-64 Installer.
Install Python 2.7
Run your newly downloaded Python installer. Follow the instructions. Do not change the install directory, but keep it at “C:\Python27\” as we will be refering to it later on.
Add python executable to system path
pythonfrom anywhere on the commandline, instead of
C:\Python27\python.exe, we add python directory to the system path. Open up the “Environment variables” as described here.
1. Create a new System variable, name it ```PYTHONPATH``` and add the following line: ```C:\Python27;C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk;C:\Python27\Scripts``` 2. Open the system variable named ```path``` 3. At the end of the line add a semicolon (;) if it is not already there. 4. After the ';' sign, add ```%PYTHONPATH%```
Python is now installed and can be used from the commandline by typing
python. Take a look at the usage to get you started or continue to install PIL and benefit from all the HTPC Manager features.
Python Image library
Installing PIL on windows can be diffucult. Most downloads require the installation of visual studio so PIL can be compiled on your system. I used a precompiled version of PIL for windows.
Download the precompiled PIL installer
- Python 2.7 x64
- Python 2.7 32 bit comming soon!
Execute your downloaded PIL installer and follow the instructions to complete the PIL install.
If everything went well, the Python Image Library is now installed. All images retieved from Xbmc should now show up nicely.
HTPC Manager works great on Linux with Python. use Python 2.7 if possible. Download the latest zip, tar.gz or do a Git-clone.
Cd into the directory where you extracted the htpc-manager folder and from there, launch HTPC Manager
Python Image library
For the Xbmc images to work, you Need PIL. The Python Image Library. If you don’t care about images or do not use Xbmc, you can skip this.
PIL requires a few libraries, install with:
sudo apt-get install libjpeg libjpeg-dev libpng-dev libfreetype6 libfreetype6-dev zlib1g-dev
PIL can be installed with PIP as explained here.
sudo apt-get install python-pip
And finally, install PIL. Or follow these instructions
sudo pip install PIL
If all went well, PIL has been installed. Check the install message to see jpeg and png support.
--------------------------------------------------------------- *** TKINTER support available --- JPEG support available --- ZLIB (PNG/ZIP) support available --- FREETYPE2 support available *** LITTLECMS support not available ---------------------------------------------------------------
HTPC Manager supports the use of a reverse proxy. To use a reverse proxy HTPC Manager must run on a different webdir. By default HTPC Manager runs on it’s ow port, in the root. If you want to use a reverse proxy you might want to set the webdir to /htpc. In the settings you can configure a custom webdir/basepath (restart required).
A second option is to set the webdir from the commandline with the “webdir” parameter.
Htpc.py --webdir "/htpc"
From then on HTPC Manager runs on localhost:8085/htpc
If you use apache, this vhost config might help you get started. Remeber to activate mod_proxy for apache.
<VirtualHost *:80> ServerName localhost ServerAlias 127.0.0.1 ProxyPreserveHost on ## htpc manager <Location /htpc> order deny,allow deny from all allow from all ProxyPass http://192.168.2.30:8085/htpc ProxyPassReverse http://192.168.2.30:8085/htpc </Location> </VirtualHost>
Keep in mind to add the ‘/htpc’ on the Location-tag and in the ProxyPass and ProxyPassReverse settings.