2017-01-10 00:01:50 +01:00
# Installing LBRY
2015-08-20 17:27:15 +02:00
2017-01-20 18:27:19 +01:00
The recommended way to install LBRY is to use an installer. We provide installers for all major operating systems. See the [README ](README.md ).
2015-08-20 17:27:15 +02:00
2017-01-29 21:45:11 +01:00
These instructions are for installing from source code, which is recommended if you are interested in doing development work or LBRY is not available on your operating system (godspeed, TempleOS users).
2015-08-20 17:27:15 +02:00
2017-01-10 00:01:50 +01:00
## Prerequisites
2015-08-20 17:27:15 +02:00
2017-01-10 00:01:50 +01:00
Before starting, you'll need to install some additional libraries depending on your operating system.
2015-08-20 17:27:15 +02:00
2018-02-27 20:10:49 +01:00
### Python
LBRY requires Python 2.7. Python 3 is not supported.
2017-01-10 00:01:50 +01:00
### OS X Prerequisites
2016-05-23 21:21:47 +02:00
2017-01-10 00:01:50 +01:00
Install [xcode command line tools ](https://developer.xamarin.com/guides/testcloud/calabash/configuring/osx/install-xcode-command-line-tools/ ) and [homebrew ](http://brew.sh/ ).
2016-05-23 21:21:47 +02:00
2017-01-10 00:01:50 +01:00
Remaining dependencies can then be installed by running:
2016-09-22 19:19:28 +02:00
```
2017-04-03 22:09:55 +02:00
brew install mpfr libmpc protobuf
2016-09-22 19:19:28 +02:00
sudo easy_install pip
sudo pip install virtualenv
```
2017-01-10 00:01:50 +01:00
### Linux Prerequisites
2016-09-22 19:19:28 +02:00
2017-01-10 00:01:50 +01:00
On Ubuntu (we recommend 16.04), install the following:
2016-09-22 19:19:28 +02:00
2017-01-10 00:01:50 +01:00
```
2018-02-01 17:04:36 +01:00
sudo apt-get install build-essential python2.7 python2.7-dev python-pip git python-virtualenv libssl-dev libffi-dev python-protobuf
2017-01-10 00:01:50 +01:00
```
2016-01-27 04:52:55 +01:00
2017-06-01 20:23:57 +02:00
On Raspbian, you will also need to install `python-pyparsing` .
2017-01-10 00:01:50 +01:00
If you're running another Linux flavor, install the equivalent of the above packages for your system.
2016-09-22 19:19:28 +02:00
2017-01-10 00:01:50 +01:00
### Windows Prerequisites
2016-01-27 04:52:55 +01:00
Install [mingw32 ](http://www.mingw.org/ ) base and c++ compiler.
Add C:\MinGW\bin to the windows PATH.
2017-01-10 00:01:50 +01:00
Enable distutils to compile with mingw32 by creating a distutils.cfg file in *PYTHONPATH\Lib\distutils* containing:
2016-01-27 04:52:55 +01:00
```
[build]
compiler = mingw32
```
2017-01-10 00:01:50 +01:00
If using virtualenv, which is recommended, copy the *PYTHONPATH\Lib\distutils* directory to the virtualenv.
2016-01-27 04:52:55 +01:00
It's recommended to use [Unofficial Windows Binaries for Python Extension Packages ](http://www.lfd.uci.edu/~gohlke/pythonlibs/ ) for as many of the required packages as possible.
Currently, available binaries include:
- Cython
- Twisted
- Zope.interface
- pywin32
- requests
2017-01-24 17:52:02 +01:00
Install the above binaries with `pip install *.whl`
2016-01-27 04:52:55 +01:00
Install pywin32 system files by run `python.exe Scripts\pywin32_postinstall.py -install` from an elevated command prompt.
2017-01-24 17:51:12 +01:00
Finally, you'll need [miniupnpc ](https://pypi.python.org/pypi/miniupnpc/1.9 ). Download the source and compile with MinGW by running `mingw32make.bat` . Then install the module by running `python setupmingw32.py install` .
2017-01-10 00:01:50 +01:00
## Installation
2017-01-21 17:13:55 +01:00
To install:
2017-01-10 00:01:50 +01:00
```
2017-01-21 17:13:55 +01:00
git clone https://github.com/lbryio/lbry.git
cd lbry
2017-01-10 00:01:50 +01:00
virtualenv lbry-venv
source lbry-venv/bin/activate
2018-02-27 20:12:15 +01:00
python --version # Python 3 is not supported. Make sure you're on Python 2.7
2017-02-08 02:51:10 +01:00
pip install -U -r requirements.txt
2017-01-24 17:51:12 +01:00
pip install --editable .
2017-01-10 00:01:50 +01:00
```
2016-01-27 04:52:55 +01:00
2017-01-10 00:01:50 +01:00
To start LBRY, run `lbrynet-daemon` in a terminal.
2017-01-21 17:13:55 +01:00
2017-01-24 17:51:12 +01:00
To verify your install, `which lbrynet-daemon` should return a path inside of the `lbry-venv` folder created by the `virtualenv` command.
2017-01-21 17:13:55 +01:00
## Making a Change
2017-01-21 17:17:05 +01:00
If you are not already inside the virtual environment, run:
```
source lbry-venv/bin/activate
```
Then run:
2017-01-21 17:13:55 +01:00
```
2017-01-24 17:51:12 +01:00
pip install --editable .
2017-01-21 17:13:55 +01:00
```
2017-01-21 17:17:05 +01:00
2018-03-21 13:25:24 +01:00
This will install `lbrynet-daemon` in such a way that the changes you make to the code will be used as soon as you restart the daemon.
Happy hacking!