From 2d34a9e640daa77092f153dcece64ad9d945c0ee Mon Sep 17 00:00:00 2001 From: George Hotz Date: Sat, 29 Feb 2020 14:50:40 -0800 Subject: [PATCH] setup ubuntu improvements old-commit-hash: 3693aa56a7e135fb1ecf25190b158d0f450c6a55 --- tools/openpilot_env.sh | 17 ++++++++++------- tools/requirements.txt | 4 ++-- tools/ubuntu_setup.sh | 41 +++++++++++++++++++---------------------- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tools/openpilot_env.sh b/tools/openpilot_env.sh index 25ed541445..35d221613c 100644 --- a/tools/openpilot_env.sh +++ b/tools/openpilot_env.sh @@ -1,9 +1,12 @@ -export PATH="$HOME/.pyenv/bin:$PATH" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" +if [ -z "$OPENPILOT_ENV" ]; then + export PATH="$HOME/.pyenv/bin:$PATH" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" -export PYTHONPATH="$HOME/openpilot" -export PATH="$PATH:$HOME/openpilot/external/capnp/bin" -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/openpilot/external/capnp/lib" + export PYTHONPATH="$HOME/openpilot" + export PATH="$PATH:$HOME/openpilot/external/capnp/bin" + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/openpilot/external/capnp/lib" + + export OPENPILOT_ENV=1 +fi -export OPENPILOT_ENV=1 diff --git a/tools/requirements.txt b/tools/requirements.txt index ef1e743910..03afaa573d 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -3,9 +3,9 @@ atomicwrites futures libarchive lru-dict -matplotlib==2.0.2 +matplotlib numpy opencv-python pygame -hexdump==3.3 +hexdump av==0.5.0 diff --git a/tools/ubuntu_setup.sh b/tools/ubuntu_setup.sh index 1a660cc9fc..14278a8b0b 100755 --- a/tools/ubuntu_setup.sh +++ b/tools/ubuntu_setup.sh @@ -41,20 +41,17 @@ sudo apt-get update && sudo apt-get install -y \ screen \ sudo \ vim \ - wget + wget \ + gcc-arm-none-eabi -# git lfs to pull models -curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash -sudo apt-get install git-lfs - -# in the openpilot repo -cd $HOME/openpilot -git lfs pull -git submodule init -git submodule update +# install git lfs +if ! command -v "git-lfs" > /dev/null 2>&1; then + curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash + sudo apt-get install git-lfs +fi # install pyenv -if [ ! -d $HOME/.pyenv ]; then +if ! command -v "pyenv" > /dev/null 2>&1; then curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash fi @@ -66,27 +63,27 @@ if [ -z "$OPENPILOT_ENV" ]; then echo "added openpilot_env to bashrc" fi -# install python 3.7.3 globally +# in the openpilot repo +cd $HOME/openpilot + +# do the rest of the git checkout +git lfs pull +git submodule init +git submodule update + +# install python 3.7.3 globally (you should move to python3 anyway) pyenv install -s 3.7.3 pyenv global 3.7.3 pyenv rehash +# **** in python env **** + # install pipenv pip install pipenv==2018.11.26 # pipenv setup (in openpilot dir) pipenv install --system --deploy -# install capnp (not needed anymore) -#cd external/capnp -#if [ ! -d lib ]; then -# ./build.sh -# git checkout bin/* # don't update these -#fi -#cd ../../ - -# at this point, manager runs - # to make tools work pip install -r tools/requirements.txt