Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: update install instructions for python virtualenv #9122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 66 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,62 @@ _(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.

### Running from tar.gz

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 (Qt6):

```
$ sudo apt-get install libsecp256k1-dev
$ python3 -m pip install --user ".[gui,crypto]"
$ sudo apt-get install python3-pyqt6
```

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 python3-cryptography
```

To run Electrum from its root directory, just do:
```
$ ./run_electrum
```

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
```

### Not pure-python dependencies
When the `virtualenv` is created or already exists, activate it:

If you want to use the Qt interface, install the Qt dependencies:
```commandline
$ . $HOME/electrum/bin/activate
```
$ sudo apt-get install python3-pyqt5

#### 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.

#### Not pure-python dependencies

For elliptic curve operations,
[libsecp256k1](https://github.com/bitcoin-core/secp256k1)
is a required dependency:
Expand All @@ -47,59 +88,47 @@ $ sudo apt-get install automake libtool
$ ./contrib/make_libsecp256k1.sh
```

Due to the need for fast symmetric ciphers,
[cryptography](https://github.com/pyca/cryptography) is required.
Install from your package manager (or from pip):
```
$ sudo apt-get install python3-cryptography
```

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


### Running from tar.gz

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:
```
$ ./run_electrum
```

You can also install Electrum on your system, by running this command:
To run Electrum, just do:
```
$ sudo apt-get install python3-setuptools python3-pip
$ python3 -m pip install --user .
$ electrum
```

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.
Or, without first activating the `virtualenv`:

```commandline
$ $HOME/electrum/bin/electrum
```

### 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):
```
$ sudo apt-get install python3-requests gettext qttools5-dev-tools
$ sudo apt-get install python3-requests gettext qt6-l10n-tools
$ ./contrib/pull_locale
```

Expand Down