| 1 |
This file contains some useful details on the installation from source code |
| 2 |
for Gramps. It does not cover installation of a pre-built binary package. |
| 3 |
For that use your package manager, the rest is already done by the packager. |
| 4 |
|
| 5 |
Uninstall old version |
| 6 |
--------------------- |
| 7 |
If you do a source install in the same place as an existing install, |
| 8 |
you need to remove the old version first. You can delete the old |
| 9 |
version by deleting the installed directories. For example, if your installation prefix is /usr/local, remove the following: |
| 10 |
/usr/local/share/gramps |
| 11 |
/usr/local/lib/pythonx.x/site-packages/gramps |
| 12 |
|
| 13 |
If you installed with a package manager you might instead need to remove |
| 14 |
/usr/local/lib/pythonx.x/dist-packages/gramps |
| 15 |
|
| 16 |
replacing pythonx.x with the Python version you used, e.g. python3.5. |
| 17 |
Also remove any gramps .egg files that are installed along with the Gramps |
| 18 |
directory and the file /usr/local/bin/gramps. |
| 19 |
|
| 20 |
If you don't know the list of all files that Gramps installed, you can |
| 21 |
reinstall it with the --record option, and take a look at the list this |
| 22 |
produces (so python setup.py install --record grampsfiles.txt |
| 23 |
|
| 24 |
Gramps is a Python application, so loading happens on reading the |
| 25 |
files, meaning that files of a previous version that are no longer |
| 26 |
present in the new version can still be loaded, making the new install |
| 27 |
unstable! |
| 28 |
|
| 29 |
Distutils install |
| 30 |
----------------- |
| 31 |
We do not check all dependencies of Gramps, see README for a list of |
| 32 |
all required and optional dependencies. Missing dependencies will |
| 33 |
result in runtime errors. |
| 34 |
|
| 35 |
To install all needed dependencies you can use (in Ubuntu): |
| 36 |
sudo apt-get build-dep gramps |
| 37 |
|
| 38 |
To build and install, whether from a tarball or git repo: |
| 39 |
python3 setup.py build |
| 40 |
sudo pip3 install . |
| 41 |
|
| 42 |
You can avoid using sudo for the install step by specifying a prefix to which you have write privilege. The default is /usr/local, which is usually owned by root. You can learn of more options with |
| 43 |
pip3 install --help |
| 44 |
|
| 45 |
One can use Gramps from the command line without installing it by |
| 46 |
setting the following environment variables, but that won't provide |
| 47 |
things like MIME type and desktop entries. |
| 48 |
|
| 49 |
export PYTHONPATH="/top/grampsdir/gramps:$PYTHONPATH" |
| 50 |
export GRAMPS_RESOURCES="/top/grampsdir" |
| 51 |
|
| 52 |
See below for ways to invoke Gramps. |
| 53 |
|
| 54 |
Typical install directories in linux (Ubuntu) are: |
| 55 |
* /usr/local/bin : the Gramps executable |
| 56 |
* /usr/local/lib/python3.10/dist-packages/gramps/ : the Gramps python module |
| 57 |
* /usr/local/share/doc/gramps : documentation, also example .gramps and .gedcom |
| 58 |
* /usr/local/share/gramps : data files |
| 59 |
* /usr/local/share/gramps/images : our images |
| 60 |
* /usr/local/share/gramps/css : css files |
| 61 |
* /usr/local/share/icons/hicolor : application icons |
| 62 |
* /usr/local/share/locale/xx/LC_MESSAGES : xx language code, translation |
| 63 |
* /usr/local/share/man/xx/man1 : xx language code, man file |
| 64 |
* /usr/local/share/applications : desktop entry |
| 65 |
* /usr/local/share/mime/packages : mime info so Gramps opens files automatically |
| 66 |
* /usr/local/share/metainfo : application metadata |
| 67 |
|
| 68 |
Running Gramps |
| 69 |
-------------- |
| 70 |
Gramps is Python only, so no compilation is needed, you can even run Gramps |
| 71 |
from the source directory. |
| 72 |
|
| 73 |
a) You installed Gramps, then you can run it with the command |
| 74 |
|
| 75 |
gramps |
| 76 |
|
| 77 |
b) You installed Gramps, and want to start it from the PYTHONPATH. In this |
| 78 |
case use the command: |
| 79 |
|
| 80 |
python3 -c 'from gramps.grampsapp import main; main()' |
| 81 |
|
| 82 |
The executable 'gramps' in /usr/local/bin or /usr/bin from a) does |
| 83 |
this for you. |
| 84 |
|
| 85 |
c) You downloaded the Gramps source code to a directory, and want to run it. |
| 86 |
You can start Gramps from the source code directory with |
| 87 |
|
| 88 |
python3 Gramps.py |
| 89 |
|
| 90 |
See gramps/gen/const.py how Gramps finds its resource directories in case |
| 91 |
you encounter problems. |
| 92 |
|
| 93 |
Custom directory installation |
| 94 |
------------------------------------- |
| 95 |
If you would like to install Gramps without being root, or in an |
| 96 |
alternative location on Windows, supply the --root argument to pip3 install |
| 97 |
|
| 98 |
For example: |
| 99 |
pip3 install . --root ~/test |
| 100 |
|
| 101 |
Packager's issues |
| 102 |
------------------ |
| 103 |
There is a MANIFEST.in file to indicate the work needed. |
| 104 |
To create a source distribution run: |
| 105 |
|
| 106 |
python3 setup.py sdist |