Skip to content

Commit cb171ad

Browse files
committed
README: update install instructions for python virtualenv
1 parent 295ea97 commit cb171ad

File tree

1 file changed

+57
-38
lines changed

1 file changed

+57
-38
lines changed

README.md

+57-38
Original file line numberDiff line numberDiff line change
@@ -18,83 +18,102 @@ _(If you've come here looking to simply run Electrum,
1818
[you may download it here](https://electrum.org/#download).)_
1919

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

24-
```
25-
$ sudo apt-get install libsecp256k1-dev
26-
$ python3 -m pip install --user ".[gui,crypto]"
27-
```
23+
### Running from tar.gz
2824

29-
### Not pure-python dependencies
25+
If you downloaded the official package (tar.gz), you can run
26+
Electrum from its root directory without installing it on your
27+
system; all the pure python dependencies are included in the 'packages'
28+
directory. You will need to install a few system dependencies:
29+
30+
To use the desktop GUI (Qt5):
3031

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

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

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

50-
Due to the need for fast symmetric ciphers,
51-
[cryptography](https://github.com/pyca/cryptography) is required.
52-
Install from your package manager (or from pip):
48+
This method currently lacks hardware wallet support.
49+
If you need hardware wallet support, you should install as [described below](#install-to-a-python-virtualenv)
50+
51+
52+
### Install to a python virtualenv
53+
54+
#### Create a python virtualenv
55+
56+
```commandline
57+
$ python3 -m venv $HOME/electrum
5358
```
54-
$ sudo apt-get install python3-cryptography
59+
60+
When the `virtualenv` is created or already exists, activate it:
61+
62+
```commandline
63+
$ . $HOME/electrum/bin/activate
5564
```
5665

57-
If you would like hardware wallet support,
58-
[see this](https://github.com/spesmilo/electrum-docs/blob/master/hardware-linux.rst).
66+
#### Install electrum and dependencies
67+
68+
```commandline
69+
$ pip install .[gui,crypto,hardware]
70+
```
5971

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

61-
### Running from tar.gz
75+
#### Not pure-python dependencies
6276

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

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

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

8294

8395
### Development version (git clone)
8496

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

88-
Check out the code from GitHub:
100+
#### Check out the code from GitHub:
89101
```
90102
$ git clone https://github.com/spesmilo/electrum.git
91103
$ cd electrum
92104
$ git submodule update --init
93105
```
94106

95-
Run install (this should install dependencies):
107+
#### create and activate virtualenv
108+
109+
```commandline
110+
$ python3 -m venv $HOME/electrum
111+
$ . $HOME/electrum/bin/activate
112+
```
113+
114+
#### Run install (this should install dependencies):
96115
```
97-
$ python3 -m pip install --user -e .
116+
$ pip install -e .[gui,crypto,hardware]
98117
```
99118

100119
Create translations (optional):

0 commit comments

Comments
 (0)