Update documentation to recommend virtual env

This commit is contained in:
Mark Haines 2015-01-30 16:56:53 +00:00
parent 0b1cc7cc0b
commit e709d61964

View File

@ -95,7 +95,7 @@ Installing prerequisites on Ubuntu or Debian::
$ sudo apt-get install build-essential python2.7-dev libffi-dev \ $ sudo apt-get install build-essential python2.7-dev libffi-dev \
python-pip python-setuptools sqlite3 \ python-pip python-setuptools sqlite3 \
libssl-dev libssl-dev python-virtualenv libjpeg-dev
Installing prerequisites on Mac OS X:: Installing prerequisites on Mac OS X::
@ -103,19 +103,12 @@ Installing prerequisites on Mac OS X::
To install the synapse homeserver run:: To install the synapse homeserver run::
$ pip install --user --process-dependency-links https://github.com/matrix-org/synapse/tarball/master $ virutalenv ~/.synapse
$ source ~/.synapse/bin/activate
$ pip install --process-dependency-links https://github.com/matrix-org/synapse/tarball/master
This installs synapse, along with the libraries it uses, into This installs synapse, along with the libraries it uses, into a virtual
``$HOME/.local/lib/`` on Linux or ``$HOME/Library/Python/2.7/lib/`` on OSX. environment under ``synapse``.
Your python may not give priority to locally installed libraries over system
libraries, in which case you must add your local packages to your python path::
$ # on Linux:
$ export PYTHONPATH=$HOME/.local/lib/python2.7/site-packages:$PYTHONPATH
$ # on OSX:
$ export PYTHONPATH=$HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH
For reliable VoIP calls to be routed via this homeserver, you MUST configure For reliable VoIP calls to be routed via this homeserver, you MUST configure
a TURN server. See docs/turn-howto.rst for details. a TURN server. See docs/turn-howto.rst for details.
@ -182,23 +175,13 @@ Running Your Homeserver
To actually run your new homeserver, pick a working directory for Synapse to run To actually run your new homeserver, pick a working directory for Synapse to run
(e.g. ``~/.synapse``), and:: (e.g. ``~/.synapse``), and::
$ mkdir ~/.synapse
$ cd ~/.synapse $ cd ~/.synapse
$ ./bin/activate
$ # on Linux $ synctl start
$ ~/.local/bin/synctl start
$ # on OSX
$ ~/Library/Python/2.7/bin/synctl start
Troubleshooting Running Troubleshooting Running
----------------------- -----------------------
If ``synctl`` fails with ``pkg_resources.DistributionNotFound`` errors you may
need a newer version of setuptools than that provided by your OS.::
$ sudo pip install setuptools --upgrade
If synapse fails with ``missing "sodium.h"`` crypto errors, you may need If synapse fails with ``missing "sodium.h"`` crypto errors, you may need
to manually upgrade PyNaCL, as synapse uses NaCl (http://nacl.cr.yp.to/) for to manually upgrade PyNaCL, as synapse uses NaCl (http://nacl.cr.yp.to/) for
encryption and digital signatures. encryption and digital signatures.
@ -225,13 +208,15 @@ directory of your choice::
$ cd synapse $ cd synapse
The homeserver has a number of external dependencies, that are easiest The homeserver has a number of external dependencies, that are easiest
to install by making setup.py do so, in --user mode:: to install using pip and a virtualenv::
$ python setup.py develop --user $ virtualenv env
$ env/bin/activate
$ python synapse/dependencies | xargs -i pip install
$ pip install setuptools_trial mock
This will run a process of downloading and installing into your This will run a process of downloading and installing all the needed
user's .local/lib directory all of the required dependencies that are dependencies into a virtual env.
missing.
Once this is done, you may wish to run the homeserver's unit tests, to Once this is done, you may wish to run the homeserver's unit tests, to
check that everything is installed as it should be:: check that everything is installed as it should be::