Skip to content

Commit

Permalink
Remove virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
kdmukai committed Nov 19, 2023
1 parent 5175260 commit 3559b4d
Showing 1 changed file with 8 additions and 57 deletions.
65 changes: 8 additions & 57 deletions docs/manual_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,31 +148,6 @@ rm bcm2835-1.60.tar.gz
sudo rm -rf bcm2835-1.60
```

### Set up `virtualenv`
```bash
python -m pip install virtualenvwrapper
```

Edit your bash profile with the command `nano ~/.profile` and add the following to the end:
```bash
export WORKON_HOME=$HOME/.envs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source $HOME/.local/bin/virtualenvwrapper.sh
```
Then `CTRL-X` and `y` to exit and save changes.

Now create the virtualenv for SeedSigner:
```bash
source ~/.profile
mkvirtualenv seedsigner-env
```

For convenience you can configure your `.profile` to auto-activate the SeedSigner virtualenv when you ssh in. Once again `nano ~/.profile` and add at the end:
```bash
workon seedsigner-env
```


### Download the SeedSigner code:
```bash
git clone https://github.com/SeedSigner/seedsigner
Expand All @@ -196,9 +171,11 @@ sudo swapon /swapfile

### Install Python `pip` dependencies:
```bash
# Takes 1hr 45min on a Pi Zero 1.3
pip install -r requirements.txt
pip install -r requirements-raspi.txt
# Takes 1hr 15min on a Pi Zero 1.3
python3 -m pip install -r requirements.txt

# Only takes ~100 seconds
python3 -m pip install -r requirements-raspi.txt
```

#### `pyzbar`
Expand All @@ -209,28 +186,6 @@ The fork is required because the main `pyzbar` repo has been abandoned. This [gi
* [PR 82](https://github.com/NaturalHistoryMuseum/pyzbar/pull/82): enable `zbar`'s new binary mode. Note that this PR has a trivial bug that was fixed in our fork.


### Finish configuring the virtualenv
Set the SeedSigner `src/` directory as the project directory for the virtualenv (this is where the virtualenv will take you when you activate it):
```bash
cd src
setvirtualenvproject
```

Test it out:
```bash
# exit the virtualenv
deactivate

# change dirs to somewhere else
cd ~

# activate the virtualenv
workon seedsigner-env

# you should now be back in the SeedSigner src/ directory
pwd
```

### Optional: increase spidev buffer size
This allows `ST7789.py` to update the LCD without performing multiple write operations because the default buffer size is 4096 bytes. The default can be changed via the `/boot/cmdline.txt` file. You will need to add `spidev.bufsiz=131072` to the end of this single lined file command.

Expand All @@ -254,7 +209,7 @@ Description=Seedsigner
[Service]
User=pi
WorkingDirectory=/home/pi/seedsigner/src/
ExecStart=/home/pi/.envs/seedsigner-env/bin/python3 main.py > /dev/null 2>&1
ExecStart=/usr/bin/python3 main.py > /dev/null 2>&1
Restart=always

[Install]
Expand Down Expand Up @@ -303,13 +258,9 @@ sudo rm /var/swap

## Manually start the SeedSigner code
```bash
# activate the virtualenv if you haven't already
workon seedsigner-env

# You should now be in the SeedSigner src/ directory. List its contents:
ls
cd ~/seedsigner/src

# You should see the main.py file. Run it:
# You'll find the main.py file in that directory. Run it:
python main.py

# To kill the process, use CTRL-C
Expand Down

0 comments on commit 3559b4d

Please sign in to comment.