fpdb Installation Overview
Introduction
fpdb is written in a computer language name python, and python must be installed on your computer for you to run pfdb. Python is installed by default on many modern computer systems, but not, unfortunately, on Microsoft Windows systems. Additionally fpdb depends on several python libraries which perform functions like drawing windows, interfacing to databases, or drawing graphs. Finally you will need a database manager that will manage the large amount of information generated from your poker play. fpdb supports two database managers, MySQL and PostgreSQL. If you haven't already, please review the Requirements
Detailed Installation Instructions
If all you want to do is get fpdb running as quickly as possible, skip to these simple installation instructions:
Unless you actually know what you are doing you should follow those installation instructions. Additional background information is supplied below.
Python
Most fpdb developing and testing is done on python version 2.5. fpdb is reported to work under python 2.6 with both Windows and LInux. Development and testing will transition to version 2.6 at some point in the future. Python.org supplies python executables, but Linux users should get python from the repositories available for their distribution.
Python Libraries
The are the python libraries required by fpdb:
pyGTK - Gtk windowing system
MySQLdb - mysql database interface
psycopg2 - postgresql database interface
matplotlib - 2d plotting library, optional, required for graphs
numpy - numeric computing library, optional, required for graphs
Database Managers
fpdb requires that one of two database managers be installed. At present there is more support for MySQL, but PostgreSQL also works just fine.
MySQL
PostgreSQL
+ Windows
+ MacOSX
Installing in Gentoo Linux
Last checked: 3 Aug 2008, git99
These instructions are for Gentoo GNU/Linux, but if you adapt the steps installing and starting stuff it should work on any other OS as well.
TODO: postgresql instrunctions incomplete
1. Install everything.
Check if anything is already installed and if it is remove it from the command.
For mysql:
emerge mysql mysql-python pygtk numpy matplotlib -av
/etc/init.d/mysql start
rc-update add mysql default
For postgresql:
emerge postgresql pygresql pygtk numpy matplotlib -av
/etc/init.d/postgresql start
rc-update add postgresql default
2. Finishing MySQL's main setup
emerge —config mysql
The —config step will ask you for the mysql root user - set this securely, we will create a seperate account for fpdb
3. Create a mysql user and a database
Now open a shell (aka command prompt aka DOS window):
Click Start, then Run. In the opening window type "cmd" (without the inverted commas) and then click OK. A windows with a black background should open.
Type (replacing yourPassword with the root password for MySQL you specified during installation):
mysql —user=root —password=yourPassword
It should say something like this:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.60-log Gentoo Linux mysql-5.0.60-r1
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Now create the actual database. The default name is fpdb, I recommend you keep it. Type this:
CREATE DATABASE fpdb;
Next you need to create a user. I recommend you use the default fpdb. Type this (replacing newPassword with the password you want the fpdb user to have - this can, but for security shouldn't, be the same as the root mysql password):
GRANT ALL PRIVILEGES ON fpdb.* TO 'fpdb'@'localhost' IDENTIFIED BY 'newPassword' WITH GRANT OPTION;
4. Installing fpdb itself
Download the latest release from https://sourceforge.net/project/showfiles.php?group_id=226872&package_id=274606 and unpack it to any folder.
In the pyfpdb folder rename HUD_config.xml.example to HUD_config.xml and edit it. Find this section:
<supported_databases>
<database db_name="fpdb" db_server="mysql" db_ip="localhost" db_user="fpdb" db_pass="YOUR MYSQL PASSWORD" db_type="fpdb"> </database>
</supported_databases>
and change YOUR MYSQL PASSWORD to whatever you entered at the end of step 3
5. Finishing up
TODO: update this
Run the GUI as described in readme-user and click the menu database -> recreate tables
That's it! Now see readme-user.txt for usage instructions.
License
Trademarks of third parties have been used under Fair Use or similar laws.
Copyright 2008-2009 Steffen Schaumburg
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.2 as published by the Free Software Foundation; with
no Invariant Sections, no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license can be found in fdl-1.2.txt
The program itself is licensed under AGPLv3, see agpl-3.0.txt
Download fpdb
Download a release
We try to make milestone releases of fpdb that aren't broken. This may be the best place to start. Get the latest release from downloads.
From git sources
This will grab a bleeding edge copy from Ray's repository.
$ sudo apt-get install git-core
$ git clone git://git.assembla.com/free_poker_tools.git fpdb
will plonk it in a subdirectory of your current directory.
Other git repositories are listed in For Developers.
Install the required Python libraries
The project uses some python libraries that aren't part of a default install of desktop Ubuntu.
The package names are:
python-mysqldb (and/or python-psycopg2 python-pgsql)
python-matplotlib (required for graphing)
python-matplotlib-data (required for graphing)
python-numeric (required for graphing)
python-numpy (required for graphing)
python-pypoker-eval (optional, no functionality using this yet)
They can be installed using Synaptic or apt.
Installing and configuring a database
You will also need to have a database running — you can choose mysql or postgresql. In each case you must create a database and user for fpdb to use.
(A) mysql
If you don't yet have mysql installed, install it with
$ sudo apt-get install mysql-server
Then use the mysql shell to create a database called fpdb and grant all privileges to a user called 'fpdbuser':
$ mysql --user=root --password=YourMysqlRootPassword
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.60-log Ubuntu Linux mysql-5.0.60-r1
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE fpdb;
mysql> GRANT ALL PRIVILEGES ON fpdb.* TO 'fpdbuser'@'localhost' IDENTIFIED BY 'newFpdbPassword' WITH GRANT OPTION;
(B) postgresql
If you want to use postgresql, make sure the dependencies are installed and your postgres root user has a password as follows:
$ sudo apt-get install postgresql, python-psycopg2, pgadmin3
$ sudo -u postgres psql postgres
Welcome to psql 8.3.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
postgres=# ALTER USER postgres WITH ENCRYPTED PASSWORD 'newPostgresRootPassword';
ALTER ROLE
postgres=# \q
You can use a graphical tool to create the fpdb database and user:
$ pgadmin3
Click connect (top left; a plug) and fill in:
- name: a name you give to this connection
- host: localhost
- password: newPostgresRootPassword
You may choose to store the password, if you do you will be warned that it will be stored in plaintext in ~/.pgpass
You should now be connected to postgres on localhost. Expand the + next to it. Add a user called fpdbuser by right clicking on Login Roles->New Login Role. Just enter the name 'fpdbuser' and a password.
Now create the fpdb database by right clicking 'Databases->New Database'. Call it fpdb and set the owner to fpdbuser.
Configuring fpdb
Now you need to tell fpdb about the database. Edit 'HUD_config.xml.example' from the pyfpdb directory and save it in the same directory as 'HUD_config.xml' (just drop off the .example)— fpdb will read this in preference to the example config.
Open it in a text editor and find the section
<supported_databases>
<database db_name="fpdb" db_server="mysql" db_ip="localhost" db_user="fpdb" db_pass="YOUR MYSQL PASSWORD" db_type="fpdb"> </database>
</supported_databases>
and alter it as appropriate with your password, 'fpdbuser' for the db_user, and 'mysql' or 'postgresql' as chosen, e.g.
<supported_databases>
<database db_ip="localhost" db_name="fpdb" db_pass="your_fpdbuser_pass" db_server="postgresql" db_type="fpdb" db_user="fpdbuser"> </database>
</supported_databases>
OK, change directory to fpdb/pyfpdb and run fpdb.py (you may need to add execute permission with chmod u+x fpdb.py). If it works and connects to the fpdb database you created, you'll be told you need to create the tables.. follow the instructions!
Installing and Updating fpdb With Git
Introduction
Git is the souce code management system that we (the devs) use to manage the source files, echange files, keep track of changes, etc. It provides the same resource to us as SVN, CVS, and others do for other projects. This wiki page just gives you the bare minimum of information needed to use git to get and update the fpdb source files. If you want to learn more about git, this tutorial is probably a good place to start.
Install git
Linux: Use your package manager to install from your distro's package repository. Example:
yum install git or apt-get install git
Windows: Get and run the installer from here.
Start a fpdb local repository:
Open a terminal and cd to where you want to set up your repo.
Enter this command:
git clone git://git.assembla.com/free_poker_tools.git
That creates an exact copy of the remote repository in your current folder. The repo will be in the subfolder named "free_poker_tools". That example points at my repo, the other developers also have public repositories that you can use.
To run fpdb:
Double click on the fpdb.py icon in your "free_poker_tools/pyfpdb" folder. Or open a terminal window, navigate to the "free_poker_tools/pyfpdb" folder and start fpdb with this command:
Linux:
./fpdb.py
Windows:
python fpdb.py
To update fpdb:
Open a terminal window, cd to the free_poker_tools folder. Enter this command:
git pull origin master
Reverting to a "known good" tagged version
It is possible that a critical bug accidently gets into the current git. You can always revert to the last tagged release, with this command:
git checkout 0.11
Substitute the version number of the last release for 0.11 in the above example. Get a list of all tagged versions in your repo with:
git tag -l
(that is a -EL for list)
This is the old windows install page that corresponds to installer version 0.1. I am leaving it here during the transition to the new installer in case it is helpful. If you are using the 0.2 version use the Install in Windows page.
For reference, here are the old manual instructions. <==broken link
Note that they are somewhat outdated. It is strongly recommended that you use the installer as described on this wiki page!
=== ===
1. A note for Windows Vista users
Unfortunately the installer does not (yet) install MySQL on Windows Vista, so you have to install it manually before running the installer. If you use Windows Vista please follow this howto (pdf) to install MySQL and then proceed with step 2. When you run the installer in step 3 it will detect the existing MySQL installation and not try to reinstall. If prompted please ensure to activate TCP/IP networking. You can (and should) however block the MySQL port on your firewall.
You then need to open a command prompt and type this:
mysql -u root -p
It will prompt you for the MySQL root password which you set during installation. After entering the correct password it will open a MySQL prompt. Type the following, replacing newPassword with a password of your choice. This is your MySQL fpdb user password and will be needed later
CREATE DATABASE fpdb;
GRANT ALL PRIVILEGES ON fpdb.* TO 'fpdb'@'localhost' IDENTIFIED BY 'newPassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
QUIT;
2. A note on database backends (important for everyone)
These instructions assume you will be using MySQL, PostgreSQL instructions are following:
- Download (pgInstaller) and install PostgreSQL (you can follow this walkthrough until point 11, 12 and next aren't necessary).
- Go to Start->Programs->PostgreSQL 8.3->pgAdmin III
- Right-clic on the service and clic connect.
- Select Login Roles and create a new login role with this data: Role Name: "fpdb" (without quotes); password: you decide it ;) and tic "Can create Roles" and "Can create DataBase Objects" (or something like that).
- Select DataBases and create a new database object with this data: Name: "fpdb" (again, without quotes) and in owner select fpdb (the role that we have created).
- Close pgAdmin (or leave it open, it doesn't matter).
IMPORTANT!!! AFTER doing points 3 and 4 of this walkthrough you have to edit Hud_config.xml (with notepad) as in point 4 AND change from db_server="mysql" to this: db_server="postgresql".
When you start fpdb for the first time it will ask you to recreate databases (It's as easy as (in fpdb) Database->Create or Recreate Tables and clic yes on the warning.
3. Download and run the Environment Installer
Go to the environment installer download page and download the latest version of it, then double click it and follow the prompts. Note that you have to restart after running the installer. This will set up all the required dependencies (support programs) for fpdb.
If necessary the Installer will install MySQL, in this case you will be prompted for two passwords:
- The MySQL root password, used to control access to the MySQL database
- The MySQL fpdb password, used to access the fpdb database in MySQL
4. Get and configure fpdb
Go to https://sourceforge.net/project/showfiles.php?group_id=226872 and download the latest of fpdb. Unpack the archive to anywhere.
Finally open the file HUD_config.xml in the pyfpdb directory. About half a dozen lines before the end you will see this: db_pass="YOUR MYSQL PASSWORD".
Replace that with the mysql fpdb user password you set during MySQL setup (Step 1 for Vista users, Step 3 for everyone else).
5. Run fpdb
Now open the directory where you unpacked fpdb, go into the subdirectory pyfpdb, and double click fpdb.py. It should now open the main window. If you have any problems please see the Contact/Get Help page.
Random Advice for Vista Users
Introduction
None of the current fpdb developers use Windows Vista. Several Vista users are now using Fpdb effectively. I will collect vista advice and post it on this page.
Getting/Installing Required Python Modules
The environment installer breaks under Vista, so Vista users must install the dependencies by hand. 2+2 forum memeber ekdikeo has provided a single zipped download of the required modules. Here is a copy of his 2+2 post:
OK, This is not exactly an installer package, but I did put
together a zip file of all of the files that I used to get
it working when I upgraded to Python 2.6, on Windows.
Graphs will not work with this setup, until someone gets a
working version of MatPlotLib with all the support functions.
This zip also does not include FPDB itself, a database, or
GTK. just all the stuff needed to get Python working with it.
So, in addition to these files, you'll need to also get ..
FPDB, GTK, MySQL (or PGSQL, if/when that works fully)
http://redir.zombiebytes.com/fpdbstuff.zip
I think the order of installation should go something like:
python-2.6.1.msi
MySQL-python-1.2.2 ...
pywin32-213.win32-py2.6.exe
pygtk-2.12.1-3-win32...
pycairo-1.4.12-2.win32-...
pygobject-2.14.2-2.win32...
numpy-1.3.0-win32-superpack...
... i've got stuff i've got to get to doing right now, but i'll
try to pick up the mysql and gtk installer and put them in here
as well, and then maybe i can at least throw together a dumb bat
file to install them all serially, so it won't be super simple,
but at least it can be done in one pack, and with a whole bunch
of "Next" clicks.
ekdikeo's original 2+2 forum post is here.
Vista Security Advice
2+2 forum member 1meandog4u posted this advice on how to set up the Vista security settings.
As a non programmer, I probably shouldn't even respond
to this. But, I am running it and getting the hud and
stats, on Vista with the 64bit dual processor. Have
patience and faith, it does work, and well.... well, it
works but am anxious to see further development.
I am running Python 2.6 and MySql 5.1 (which is not the
latest as I have recently seen newer versions) but "if
it ain't broke, why fix it?" is my motto. And I am
running FPDB version 11.1
I did one thing that seemed to help. I set up the directory
and all the files in Python to "run as administrator"
just to make sure, as well as Mysql. I did the "properties"
opening and any file in those two directories that would
allow me to change the "run as administrator", then I clicked
that box. Also, it wanted to put Python, by default, in
c:\Program Files\Python26 directory. But after having
problems, I read some docs on that site and it suggested
the root c:\Pyton26 instead.
Between all the changes to "run as admin" and
oving/installing Python26 to the root c: directory, one
or many of them seemed to do the trick. I also had some
password problems with Mysql and with help from Sorrow,
got that fixed. Can't remember what we did though... my
mind is too old to remember beyond a couple of days ago
Keep at it. I love how mine works. I gave up three times,
but then it worked and while not yet polished, I feel I'm
at least part of the pack.
Dog