install_pipenv.md 1.54 KB
Newer Older
Moul's avatar
Moul committed
1 2
# Install Silkaj with Pipenv

3 4 5 6 7 8 9 10
### Install libsodium

```bash
sudo apt install libsodium23 # Debian Buster
sudo apt install libsodium18 # Debian Stretch
sudo dnf install libsodium # Fedora
```

Moul's avatar
Moul committed
11 12
### Install pipenv

13 14 15 16 17
```bash
sudo apt install pipenv # Debian ≥ Buster
sudo dnf install pipenv # Fedora
```

Moul's avatar
Moul committed
18 19 20 21 22 23 24 25
- [Pipenv installation instructions](https://github.com/pypa/pipenv#installation)

### Retrieve silkaj sources
```bash
git clone https://git.duniter.org/clients/python/silkaj.git
cd silkaj
```

26
### Install with dependencies
Moul's avatar
Moul committed
27
```bash
28
pipenv install "-e ."
Moul's avatar
Moul committed
29 30
```

31 32
The double quotes are important, if you forget them, `pipenv` will install silkaj from pypi

Moul's avatar
Moul committed
33 34 35
### Activate pipenv and run silkaj
```bash
pipenv shell
36
silkaj
Moul's avatar
Moul committed
37
```
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

## Manage Python versions with Pyenv

If you have trouble with the pipenv install, may be the Python version installed on your system is not up to date.
To install and manage easily multiple Python version, use Pyenv:

### Install pyenv on your home
```bash
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
```

Add in `~/.bash_profile`, in `~/.bashrc` on Fedora or Ubuntu:

```bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv virtualenv-init -)"
eval "$(pyenv init -)"
export PYENV_ROOT="$HOME/.pyenv"
```

Reload your bash config:

    source ~/.bashrc

or

    source ~/.bash_profile

### Install Python version required

Moul's avatar
Moul committed
68
    pyenv install 3.7.2
69 70 71

### Select Python version for the current shell

Moul's avatar
Moul committed
72
    pyenv shell 3.7.2
73 74

Pipenv will search the `Pyenv` Python version chosen before the system version.