Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

Commit

Permalink
Simplified create-venv script
Browse files Browse the repository at this point in the history
  • Loading branch information
synesthesiam committed Dec 7, 2019
1 parent 5834c4f commit 080ba2e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions create-venv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ this_dir="$( cd "$( dirname "$0" )" && pwd )"
DEFINE_string 'venv' "${this_dir}/.venv" 'Path to create virtual environment'
DEFINE_string 'download-dir' "${this_dir}/download" 'Directory to cache downloaded files'
DEFINE_boolean 'system' true 'Install system dependencies'
DEFINE_boolean 'flair' true 'Install flair'
DEFINE_boolean 'precise' true 'Install Mycroft Precise'
DEFINE_boolean 'flair' false 'Install flair'
DEFINE_boolean 'precise' false 'Install Mycroft Precise'
DEFINE_boolean 'adapt' true 'Install Mycroft Adapt'
DEFINE_boolean 'google' true 'Install Google Text to Speech'
DEFINE_boolean 'google' false 'Install Google Text to Speech'
DEFINE_boolean 'kaldi' true 'Install Kaldi'
DEFINE_boolean 'offline' false "Don't download anything"
DEFINE_integer 'make-threads' 4 'Number of threads to use with make' 'j'
Expand Down Expand Up @@ -51,6 +51,10 @@ if [[ "${FLAGS_kaldi}" -eq "${FLAGS_FALSE}" ]]; then
no_kaldi='true'
fi

if [[ "${FLAGS_google}" -eq "${FLAGS_FALSE}" ]]; then
no_google='true'
fi

if [[ "${FLAGS_offline}" -eq "${FLAGS_TRUE}" ]]; then
offline='true'
fi
Expand Down Expand Up @@ -103,10 +107,16 @@ if [[ -z "${no_system}" ]]; then
fi

# -----------------------------------------------------------------------------
# Python 3.6
# Python >= 3.6
# -----------------------------------------------------------------------------

if [[ -z "$(which python3.6)" ]]; then
if [[ ! -z "$(which python3.8)" ]]; then
PYTHON='python3.8'
# elif [[ ! -z "$(which python3.7)" ]]; then
# PYTHON='python3.7'
elif [[ ! -z "$(which python3.6)" ]]; then
PYTHON='python3.6'
else
echo "Installing Python 3.6 from source. This is going to take a LONG time."
sudo apt-get install --no-install-recommends --yes \
tk-dev libncurses5-dev libncursesw5-dev \
Expand All @@ -123,6 +133,8 @@ if [[ -z "$(which python3.6)" ]]; then
./configure && \
make -j "${make_threads}" && \
sudo make altinstall

PYTHON='python3.6'
fi

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -167,7 +179,6 @@ bash download-dependencies.sh "${download_args[@]}"

cd "${this_dir}"

PYTHON="python3.6"
echo "${venv}"

if [[ -d "${venv}" ]]; then
Expand All @@ -191,7 +202,7 @@ export LD_LIBRARY_PATH="${venv}/lib:${LD_LIBRARY_PATH}"
source "${venv}/bin/activate"

echo "Installing Python requirements"
"${PYTHON}" -m pip install wheel
"${PYTHON}" -m pip install wheel setuptools
"${PYTHON}" -m pip install requests

# pytorch is not available on ARM
Expand Down

0 comments on commit 080ba2e

Please sign in to comment.