I'm trying to run FAF (natively) in conjunction with FA (through wine)
(due to the views this post receives and to how much the methods have updated I've decided to update this question for it to answer as well as ask. check revision history of this post for the process to finding the old method to run the python client and the old guides)
Beta-state Java Client :
use this script : (updated 3/12/2019)
https://github.com/tatsujb/installFAFscript
https://www.youtube.com/watch?v=BEWUEoQ8Q4k
Python client : (NOW OBSOLETE)
How to: compile this python app (FAF) from source :
up and running thanks to @edwinksl 's "Python 3 with PyQt5" guide. marked him as solution. good job!
Update (31/1/2018)
Sorry I took so long to update this post. it's gotten 7000 views! it really deserves up-to-date info.
Since I asked a lot has happened. FAF now has more or less linux support. they even have a wiki to installing it (and per distro!) :
https://wiki.faforever.com/index.php?title=Setting_Up_FAF_Linux#Debian.2FUbuntu
it's not guaranteed to fit your needs, more can be found by digging in : http://forums.faforever.com/viewtopic.php?f=2&t=4507
right now the wiki isn't all that up to date.
for awhile I could get faf to run with native python, no virtualenv needed but QT's aver changing dependencies and package composition as well as the FAF usage of them has broken that again ... temporarily I hope !
rest assured I've got it running personally and I'm here to offer solace (try skipping steps 6 & 7 first they may be unneeded ):
- Install some prerequisites :
sudo apt update && sudo apt install wget PyQt5.QtMultimedia python3-idna python3-semantic-version python3-pyqt5 python3-pyqt5.qtwebengine
cd Downloads && wget https://github.com/FAForever/client/archive/0.16.1.tar.gz
(or whichever release is latest at https://github.com/FAForever/client/releases/ )- extract (for this example I'll extract to home) (
cd Downloads/ && mv client-0.16.1.tar.gz ~/ && cd && tar -zxf client-0.16.1.tar.gz && mv client-0.16.1 faf-client && rm client-0.16.1.tar.gz
) cd fafclient/
: move to the working dirrectorysed -i 1,1d requirements.txt
: removes cxFreeze from the requirements (it's not required and it will kill compile)virtualenv -p python3 faf
pip install -r requirements.txt
sudo wget https://github.com/FAForever/uid/releases/download/v4.0.5/faf-uid -O /usr/bin/faf-uid
: downloads login binary and :sudo chmod +x /usr/bin/faf-uid
allows it to be executed by faf.touch res/RELEASE-VERSION && echo "0.16.1" >> res/RELEASE-VERSION
: fulfills faf's final requirement : a release version file.
now it should run but for the heck of it let's make a runner :
touch FAF.sh
echo "#! /bin/bash" >> FAF.sh
echo "cd /home/t/faf-client" >> FAF.sh
echo "python3 src/__main__.py" >> FAF.sh
chmod +x FAF.sh
then ./FAF.sh
to run FAF.
Cheers!
Note: the steps for Python 3 with PyQt5 are proven to work while the steps for Python 2 with PyQt4 and PySide are still experimental.
Python 3 with PyQt5 (proven to work)
It appears that the
474-feature-py3
branch of the FAForever/client GitHub repository uses Python 3 with PyQt5, which contains QtWebKit. Therefore, using this branch is the most straightforward solution. Note that PyQt5 (but not PyQt4) can in fact be installed withpip
, so that makes things way more convenient.Steps for Python 3 with PyQt5:
cd
into a directory of your choice, which will be~/Desktop/temp
for the purpose of writing this answer,git clone
the FAForever/client GitHub repository andgit checkout
the474-feature-py3
branch:Create and activate a virtualenv for Python 3 (the default is Python 3.5 for Ubuntu 17.04) and force-upgrade
pip
just to make sure it is up-to-date:Use
pip
to installPyQt5
and fromrequirements.txt
:Download the
faf-uid
binary intofaf-client/lib
and make it executable:Run
python
onsrc/__main__.py
:Python 2 with PyQt4 and PySide (experimental)
It looks like I may have figured out how to import the
QtWebKit
module, but I don't have the FAF game installed, so I cannot fully verify that this works and therefore this answer is a work in progress.In a nutshell, I used
apt
to installpython-qt4
, which does not have theQtWebKit
module. I created and activated a virtualenv without using the--system-site-packages
option and usedpip
to installPySide
, which does have theQtWebKit
module. I then symlinked the appropriate system libraries and files for PyQt4 into the virtualenv. Then I made a couple of changes tofaf-client/src
to import theQtWebKit
module fromPySide
. This solution is inspired by https://stackoverflow.com/a/28850104/486919, https://stackoverflow.com/a/36887302/486919 and https://stackoverflow.com/a/37616466/486919.Steps:
Install
python-qt4
:cd
into a directory of your choice, which will be~/Desktop/temp
for the purpose of writing this answer,git clone
my version of the repository andgit checkout
thepatch
branch:This
patch
branch has several additional commits compared to the defaultdevelop
branch: 1) it gets rid of the version specification forcx_Freeze
, which was giving me installation problems if I used the4.3.4
version previously specified, and 2) it importsQtWebKit
fromPySide
instead ofPyQt4
.Create and activate a virtualenv for Python 2 and force-upgrade
pip
just to make sure it is up-to-date:Use
pip
to installPySide
and fromrequirements.txt
:Download the
faf-uid
binary intofaf-client/lib
and make it executable:cd
to thesite-packages
directory inside the virtualenv and make appropriate symlinks:Note the
.
at the end of each symlink.cd
back tofaf-client
and runpython
onsrc/__main__.py
:Check
~/.bashrc
for Python version overrideThe package you are wanting to compile requires Python version 2.7.x. Confirm that with these commands:
That was the problem in this Q&A.
You are not alone with
linux error PyQt4 import QtWebKit
google search:Unfortunately there are alot more google results but these I believe are the most pertinent for you to read if the first recommendation doesn't pan out.