Skip to content

Commit

Permalink
installer first version: checks for python, pip, and 7-zip
Browse files Browse the repository at this point in the history
  • Loading branch information
billyc committed May 10, 2016
1 parent 96d45d9 commit 323156c
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
18 changes: 18 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Installing SoundCast
====================

- Complete documentation is always at http://soundcast.readthedocs.io

Prerequisites:
--------------

- Windows 7+, 64-bit only
- Python 2.7 and pip (tested using Ananconda Python)


Basic setup instructions:
-------------------------

1. Clone SoundCast or grab latest .zip file from http://github.com/psrc/soundcast

2. Run install.bat
72 changes: 72 additions & 0 deletions install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@echo off

:: SoundCast installer batch file
:: =======================================
:: Full install instructions are always at
:: http://soundcast.readthedocs.io

set ZIPINSTALLER='http://www.7-zip.org/a/7z1600-x64.msi'
set POWERSHELL=%windir%\System32\WindowsPowerShell\v1.0\powershell.exe

:: ------------------------------
:: Test for python in system path

echo.
echo Checking for python...
where python.exe || goto :python-error

echo.
echo Checking for pip...
where pip.exe || goto :python-error

echo.
echo Installing python libraries...
pip install -r requirements.txt || goto :python-error

:: ----------------
:: Test for 7-zip

:test-zip
echo.
echo Checking for 7-Zip...
where 7z.exe || goto :zip-missing
goto :zip-ok

:zip-missing
echo 7-Zip not found. Installing...
"%POWERSHELL%" -Command "(New-Object Net.WebClient).DownloadFile(%ZIPINSTALLER%, '7z-setup.msi')" || :zip-error

7z-setup.msi /passive
setx path "%PATH%;C:\Program Files\7-Zip"
set PATH=%PATH%;C:\Program Files\7-Zip
goto :test-zip

:zip-ok

goto :success

:: =======================================
:python-error
echo.
echo Failed with error code #%errorlevel%
echo You need to install or set up Python. Anaconda Python is easiest:
echo https://www.continuum.io/downloads
echo.
echo Ensure python and pip are in your PATH and try again.
exit /b %errorlevel

:zip-error
echo.
echo Failed with error code #%errorlevel%
echo You need to install 7-zip and add it to your PATH
echo http://www.7-zip.org
echo.
echo Install it and try again.
exit /b %errorlevel


:: =======================================
:success
echo.
echo Done!

7 changes: 7 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# requirements.txt: list of required python libraries
# (used by pip in install.bat)

numpy
pandas
pysal
pandas_highcharts

0 comments on commit 323156c

Please sign in to comment.