Skip to content

Commit

Permalink
README: update install instructions for python virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
accumulator committed Jul 4, 2024
1 parent 295ea97 commit cb171ad
Showing 1 changed file with 57 additions and 38 deletions.
95 changes: 57 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,83 +18,102 @@ _(If you've come here looking to simply run Electrum,
[you may download it here](https://electrum.org/#download).)_

Electrum itself is pure Python, and so are most of the required dependencies,
but not everything. The following sections describe how to run from source, but here
is a TL;DR:
but not everything. The following sections describe how to run from tar.gz or from source.

```
$ sudo apt-get install libsecp256k1-dev
$ python3 -m pip install --user ".[gui,crypto]"
```
### Running from tar.gz

### Not pure-python dependencies
If you downloaded the official package (tar.gz), you can run
Electrum from its root directory without installing it on your
system; all the pure python dependencies are included in the 'packages'
directory. You will need to install a few system dependencies:

To use the desktop GUI (Qt5):

If you want to use the Qt interface, install the Qt dependencies:
```
$ sudo apt-get install python3-pyqt5
```

For elliptic curve operations,
[libsecp256k1](https://github.com/bitcoin-core/secp256k1)
is a required dependency:
Due to the need for fast symmetric ciphers,
[cryptography](https://github.com/pyca/cryptography) is required.
Install from your package manager:
```
$ sudo apt-get install libsecp256k1-dev
$ sudo apt-get install python3-cryptography
```

Alternatively, when running from a cloned repository, a script is provided to build
libsecp256k1 yourself:
To run Electrum from its root directory, just do:
```
$ sudo apt-get install automake libtool
$ ./contrib/make_libsecp256k1.sh
$ ./run_electrum
```

Due to the need for fast symmetric ciphers,
[cryptography](https://github.com/pyca/cryptography) is required.
Install from your package manager (or from pip):
This method currently lacks hardware wallet support.
If you need hardware wallet support, you should install as [described below](#install-to-a-python-virtualenv)


### Install to a python virtualenv

#### Create a python virtualenv

```commandline
$ python3 -m venv $HOME/electrum
```
$ sudo apt-get install python3-cryptography

When the `virtualenv` is created or already exists, activate it:

```commandline
$ . $HOME/electrum/bin/activate
```

If you would like hardware wallet support,
[see this](https://github.com/spesmilo/electrum-docs/blob/master/hardware-linux.rst).
#### Install electrum and dependencies

```commandline
$ pip install .[gui,crypto,hardware]
```

This will install Electrum and all required dependencies,
including for Qt desktop GUI and hardware wallets.

### Running from tar.gz
#### Not pure-python dependencies

If you downloaded the official package (tar.gz), you can run
Electrum from its root directory without installing it on your
system; all the pure python dependencies are included in the 'packages'
directory. To run Electrum from its root directory, just do:
For elliptic curve operations,
[libsecp256k1](https://github.com/bitcoin-core/secp256k1)
is a required dependency:
```
$ ./run_electrum
$ sudo apt-get install libsecp256k1-dev
```

You can also install Electrum on your system, by running this command:
Alternatively, when running from a cloned repository, a script is provided to build
libsecp256k1 yourself:
```
$ sudo apt-get install python3-setuptools python3-pip
$ python3 -m pip install --user .
$ sudo apt-get install automake libtool
$ ./contrib/make_libsecp256k1.sh
```

This will download and install the Python dependencies used by
Electrum instead of using the 'packages' directory.
It will also place an executable named `electrum` in `~/.local/bin`,
so make sure that is on your `PATH` variable.
For more information about hardware wallet dependencies,
[see this](https://github.com/spesmilo/electrum-docs/blob/master/hardware-linux.rst).


### Development version (git clone)

_(For OS-specific instructions, see [here for Windows](contrib/build-wine/README_windows.md),
and [for macOS](contrib/osx/README_macos.md))_

Check out the code from GitHub:
#### Check out the code from GitHub:
```
$ git clone https://github.com/spesmilo/electrum.git
$ cd electrum
$ git submodule update --init
```

Run install (this should install dependencies):
#### create and activate virtualenv

```commandline
$ python3 -m venv $HOME/electrum
$ . $HOME/electrum/bin/activate
```

#### Run install (this should install dependencies):
```
$ python3 -m pip install --user -e .
$ pip install -e .[gui,crypto,hardware]
```

Create translations (optional):
Expand Down

0 comments on commit cb171ad

Please sign in to comment.