417
edits
(→Using pip (generic method): Explain how to remove software from a venv) |
(→Sample installation sessions: Improve formatting by splitting the big <pre> blocks) |
||
Line 374: | Line 374: | ||
These sample sessions are given for Debian—at least for now—but the method is generic and can be applied to other distributions (the <tt>apt-get</tt> commands will have to be adapted, obviously): | These sample sessions are given for Debian—at least for now—but the method is generic and can be applied to other distributions (the <tt>apt-get</tt> commands will have to be adapted, obviously): | ||
<ol style="list-style-type: decimal"><li><strong>First session:</strong> installing FFGo (and some of its dependencies, such as [http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) using pip in a virtual environment | <ol style="list-style-type: decimal"><li> | ||
<p><em><strong>First session:</strong> installing FFGo (and some of its | |||
dependencies, such as | |||
[http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) | |||
using <tt>pip</tt> in a virtual environment.</em></p> | |||
<ul><li> | |||
<p>First, as root:</p> | <p>First, as root:</p> | ||
<p>Mandatory:</p> | |||
<pre>apt-get install python3 python3-tk python3-venv</pre> | |||
apt-get install | |||
<p>Optional—may help if you want to compile Pillow (which is automatically | |||
done if you install it using pip):</p> | |||
apt-get install geographiclib-tools | <pre>apt-get install libpython3-dev tcl-dev tk-dev</pre> | ||
<p>If the Pillow installation (later) fails even with this, | |||
run the following command as root:</p> | |||
<pre>apt-get build-dep python3-pil.imagetk</pre> | |||
<p>This will install more packages, but should definitely allow you to compile | |||
Pillow.</p> | |||
<p>Optional: to have magnetic declination, magnetic headings, etc.:</p> | |||
<pre>apt-get install geographiclib-tools | |||
# Install a minimal dataset for the MagneticField program | # Install a minimal dataset for the MagneticField program | ||
/usr/sbin/geographiclib-get-magnetic minimal | /usr/sbin/geographiclib-get-magnetic minimal</pre> | ||
<p>Highly optional, for better precision (no idea if one can see the | |||
difference for typical aviation needs):</p> | |||
/usr/sbin/geographiclib-get-magnetic emm2015</pre> | <pre>/usr/sbin/geographiclib-get-magnetic emm2015</pre> | ||
</li> | |||
<li><p>Then, <strong>as an unprivileged user:</strong></p> | |||
<p> | <p>Create a virtual environment in <tt>~/my-venvs/venv1</tt>, linked to the | ||
base Python installation that provides <tt>/usr/bin/python3.4</tt>:</p> | |||
<pre>~ % mkdir -p ~/my-venvs && cd ~/my-venvs | |||
~/my-venvs % /usr/bin/python3.4 -m venv venv1</pre> | |||
< | <p>Check what we have in there:</p> | ||
<pre>~/my-venvs % ls venv1 | |||
bin include lib lib64 pyvenv.cfg</pre> | |||
~/my-venvs % ls venv1 | |||
bin include lib lib64 pyvenv.cfg | |||
<p>Install FFGo in this venv using the <tt>pip</tt> executable <strong>from | |||
this venv</strong>. This is the crucial point. Don't run this with any | |||
<tt>pip</tt> executable you find, otherwise you won't be able to know where | |||
the installation is taking place.</p> | |||
<pre>~/my-venvs % venv1/bin/pip install ffgo | |||
~/my-venvs % venv1/bin/pip install ffgo | |||
Downloading/unpacking ffgo | Downloading/unpacking ffgo | ||
Downloading FFGo-1.9.0.tar.gz (767kB): 767kB downloaded | Downloading FFGo-1.9.0.tar.gz (767kB): 767kB downloaded | ||
Line 436: | Line 440: | ||
Successfully installed ffgo CondConfigParser | Successfully installed ffgo CondConfigParser | ||
Cleaning up... | Cleaning up...</pre> | ||
<p>Run FFGo:</p> | |||
~/my-venvs % venv1/bin/ffgo | <pre>~/my-venvs % venv1/bin/ffgo | ||
FFGo 1.9.0 started | FFGo 1.9.0 started | ||
Using: | Using: | ||
Line 452: | Line 456: | ||
particular geodetic calculations can only be done with GeographicLib. You will | particular geodetic calculations can only be done with GeographicLib. You will | ||
be notified when such a case is encountered. | be notified when such a case is encountered. | ||
Detected FlightGear version: 2016.1.0 | Detected FlightGear version: 2016.1.0</pre> | ||
<p>FFGo works. It just told us about the two optional dependencies we haven't | |||
installed. Let's install them now. There is another way that uses Debian | |||
packages (creating the venv with <tt>--system-site-packages</tt>); it is | |||
explained in | |||
[https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en docs/INSTALL/INSTALL_en], but I can't replicate all of its contents | |||
here...</p> | |||
<p>OK, so let's install these optional dependencies now:</p> | |||
~/my-venvs % venv1/bin/pip install Pillow geographiclib | <pre>~/my-venvs % venv1/bin/pip install Pillow geographiclib | ||
Downloading/unpacking Pillow | Downloading/unpacking Pillow | ||
Downloading Pillow-3.1.0.tar.gz (9.9MB): 9.9MB downloaded | Downloading Pillow-3.1.0.tar.gz (9.9MB): 9.9MB downloaded | ||
Line 476: | Line 480: | ||
[...] | [...] | ||
Cleaning up... | Cleaning up...</pre> | ||
<p>Let's start FFGo again:</p> | |||
~/my-venvs % venv1/bin/ffgo | <pre>~/my-venvs % venv1/bin/ffgo | ||
FFGo 1.9.0 started | FFGo 1.9.0 started | ||
Using: | Using: | ||
Line 487: | Line 491: | ||
- MagneticField: GeographicLib version 1.45 | - MagneticField: GeographicLib version 1.45 | ||
Detected FlightGear version: 2016.1.0 | Detected FlightGear version: 2016.1.0</pre> | ||
<p>No warning anymore: all optional dependencies have been installed.</p> | |||
</li></ul> | |||
</li> | </li> | ||
<li><strong>Second session:</strong> installing some of FFGo's dependencies (such as [http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) using pip in a virtual environment, while using FFGo directly from a clone of its [https://github.com/frougon/FFGo Git repository] | <li><p><em><strong>Second session:</strong> installing some of FFGo's | ||
dependencies (such as | |||
[http://people.via.ecp.fr/~flo/projects/CondConfigParser/ CondConfigParser]) | |||
using <tt>pip</tt> in a virtual environment, while using FFGo directly from a | |||
clone of its [https://github.com/frougon/FFGo Git repository].</em></p> | |||
<p>Create a virtual environment (the second command is equivalent to | |||
<code>/usr/bin/pyvenv-3.4 venv2</code> on Debian):</p> | |||
<pre>~ % cd ~/my-venvs | <pre>~ % cd ~/my-venvs | ||
~/my-venvs % /usr/bin/python3.4 -m venv venv2</pre> | |||
~/my-venvs % /usr/bin/python3.4 -m venv venv2 | <p>Install CondConfigParser in this venv using the <tt>pip</tt> executable | ||
<strong>from this venv</strong>:</p> | |||
<pre>~/my-venvs % venv2/bin/pip install CondConfigParser | |||
~/my-venvs % venv2/bin/pip install CondConfigParser | |||
Downloading/unpacking CondConfigParser | Downloading/unpacking CondConfigParser | ||
Downloading CondConfigParser-1.0.2.tar.bz2 (46kB): 46kB downloaded | Downloading CondConfigParser-1.0.2.tar.bz2 (46kB): 46kB downloaded | ||
Line 508: | Line 517: | ||
Successfully installed CondConfigParser | Successfully installed CondConfigParser | ||
Cleaning up... | Cleaning up...</pre> | ||
<p>Clone FFGo's Git repository:</p> | |||
<pre>~ % mkdir -p ~/src && cd ~/src | |||
~/src % git clone https://github.com/frougon/FFGo.git ffgo.git | ~/src % git clone https://github.com/frougon/FFGo.git ffgo.git | ||
Cloning into 'ffgo.git'... | Cloning into 'ffgo.git'... | ||
Line 518: | Line 527: | ||
Receiving objects: 100% (3001/3001), 1.39 MiB | 940.00 KiB/s, done. | Receiving objects: 100% (3001/3001), 1.39 MiB | 940.00 KiB/s, done. | ||
Resolving deltas: 100% (1927/1927), done. | Resolving deltas: 100% (1927/1927), done. | ||
Checking connectivity... done. | Checking connectivity... done.</pre> | ||
<p>This must be done whenever you work with FFGo's Git repo (unless you know | |||
what you are doing), after <code>git clone</code> and every | |||
<code>git pull</code> to have exisiting and up-to-date icons and translation | |||
(<tt>.mo</tt>) files. This requires to have installed stuff as indicated in | |||
the <i>Installation from the Git repository</i> section of FFGo's | |||
[https://github.com/frougon/FFGo/blob/master/docs/INSTALL/INSTALL_en docs/INSTALL/INSTALL_en] | |||
file.</p> | |||
<pre>~/src % cd ffgo.git | |||
~/src/ffgo.git % make | ~/src/ffgo.git % make | ||
make -C share/icons | make -C share/icons | ||
Line 535: | Line 543: | ||
[...] | [...] | ||
make[1]: Leaving directory '/home/flo/src/ffgo.git/ffgo/data/locale' | make[1]: Leaving directory '/home/flo/src/ffgo.git/ffgo/data/locale'</pre> | ||
<p>Since FFGo was not installed with pip in this case, no <tt>ffgo</tt> | |||
executable has been created. The recommended way to run FFGo in such a case is | |||
via the <tt>ffgo-launcher.py</tt> script. The full path to | |||
<tt>ffgo-launcher.py</tt> is not needed here since it is in the current | |||
directory, however if you create an alias for this command, or if you | |||
configure an icon in your menu bar/whatever to run it, you will need the path | |||
(and maybe <tt>/home/username</tt> instead of <tt>~</tt> too). The path to the | |||
Python interpreter (<tt>~/my-venvs/venv2/bin/python</tt>), however, is crucial | |||
since it is for <em>this</em> Python interpreter that we have installed | |||
CondConfigParser.</p> | |||
<pre>~/src/ffgo.git % ~/my-venvs/venv2/bin/python ~/src/ffgo.git/ffgo-launcher.py | |||
~/src/ffgo.git % ~/my-venvs/venv2/bin/python ~/src/ffgo.git/ffgo-launcher.py | |||
FFGo 1.9.0 started | FFGo 1.9.0 started | ||
Using: | Using: | ||
Line 562: | Line 568: | ||
particular geodetic calculations can only be done with GeographicLib. You will | particular geodetic calculations can only be done with GeographicLib. You will | ||
be notified when such a case is encountered. | be notified when such a case is encountered. | ||
Detected FlightGear version: 2016.1.0 | Detected FlightGear version: 2016.1.0</pre> | ||
~/src/ffgo.git % | |||
<p>Again, FFGo works fine and just warned us about the two optional | |||
dependencies it couldn't find. They can be installed in exactly the same way | |||
as above:</p> | |||
<pre>~/src/ffgo.git % ~/my-venvs/venv2/bin/pip install Pillow geographiclib | |||
[...]</pre> | |||
</li></ol> | |||
</pre></li></ol> | |||
====== How to update ====== | ====== How to update ====== |
edits