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

Commit

Permalink
Install from pip before installing from armv6 wheels locally
Browse files Browse the repository at this point in the history
  • Loading branch information
bennuttall committed Nov 19, 2018
1 parent deff1cd commit 460c48b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fi
echo "Cloning installation scripts"
git clone -q https://github.com/astro-pi/astro-pi-stretch-installer
cd astro-pi-stretch-installer

# Check we're on desktop or lite

chromium=`dpkg -l | grep chromium | wc -l`
Expand All @@ -49,7 +50,6 @@ if [ $chromium -gt 0 ]; then
# Set Chromium homepage and bookmarks
echo "Setting your Chromium homepage and bookmarks..."
sudo python3 chromium.py

else
desktop=false
echo -e "It looks like you are running Raspbian Lite"
Expand Down Expand Up @@ -86,32 +86,12 @@ fi

echo "$t Updating and upgrading your Python packages..."

# Install Armv6 versions of opencv/tensorflow/grpcio

mkdir wheels
cd wheels
wget -q https://www.piwheels.org/simple/opencv-contrib-python-headless/opencv_contrib_python_headless-3.4.3.18-cp35-cp35m-linux_armv6l.whl
wget -q https://www.piwheels.org/simple/grpcio/grpcio-1.15.0-cp35-cp35m-linux_armv6l.whl
wget -q https://www.piwheels.org/simple/tensorflow/tensorflow-1.11.0-cp35-none-linux_armv6l.whl

for f in *armv6l.whl;
do cp $f ${f%armv6l.whl}armv7l.whl;
done

cd ../

for package in "opencv-contrib-python-headless grpcio tensorflow"; do
t=`date '+%H:%M:%S'`
echo "$t Installing $package..."
pip3 install $package --user --find-links=wheels > /dev/null
done

# Install Python packages from PyPI/piwheels - versions specified in requirements.txt

mapfile -t py_packages < requirements.txt
mapfile -t packages < requirements.txt
t=`date '+%H:%M:%S'`

for package in "${py_packages[@]}"; do
for package in "${packages[@]}"; do
t=`date '+%H:%M:%S'`
echo "$t Installing $package..."
pip3 install -q $package --user > /dev/null
Expand All @@ -125,6 +105,22 @@ else
echo "There were errors with the Python libraries. See above for more information."
fi

# Install Armv6 versions of opencv/tensorflow/grpcio from wheel files

cd wheels
for f in *armv6l.whl; # rename armv6 wheels to armv7
do cp $f ${f%armv6l.whl}armv7l.whl;
done
cd ../

packages="opencv-contrib-python-headless grpcio tensorflow"

for package in "${packages[@]}"; do
t=`date '+%H:%M:%S'`
echo "$t Installing $package..."
pip3 install $package --user --find-links=wheels > /dev/null
done

# Download some desktop background images

if $desktop; then
Expand Down
Binary file added wheels/grpcio-1.15.0-cp35-cp35m-linux_armv6l.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 460c48b

Please sign in to comment.