-WIP-electrum-btcp/electrum-env

27 lines
780 B
Plaintext
Raw Normal View History

#!/bin/bash
#
# This script creates a virtualenv named 'env' and installs all
# python dependencies before activating the env and running Electrum.
# If 'env' already exists, it is activated and Electrum is started
# without any installations. Additionally, the PYTHONPATH environment
# variable is set properly before running Electrum.
#
# python-qt and its dependencies will still need to be installed with
# your package manager.
PYTHON_VER="$(python3 -c 'import sys; print(sys.version[:3])')"
if [ -e ./env/bin/activate ]; then
2016-01-27 06:51:20 -08:00
source ./env/bin/activate
else
2017-11-27 02:42:49 -08:00
virtualenv env -p `which python3`
2016-01-27 06:51:20 -08:00
source ./env/bin/activate
2017-09-29 22:04:11 -07:00
python3 setup.py install
fi
export PYTHONPATH="/usr/local/lib/python${PYTHON_VER}/site-packages:$PYTHONPATH"
./electrum "$@"
deactivate