-
-
Notifications
You must be signed in to change notification settings - Fork 493
Windows Installation Guide
- Install Git - Use windows installer (https://git-scm.com/downloads)
- Install Python 3 (make sure it's python 3) - use windows installer (Check your computer if 32 bit or 64 bit and download accordingly) Latest Python 3 installer: https://www.python.org/downloads/release/python-363/
-
Download Repository (https://github.com/scorelab/Bassa/tree/windows) to local storage. This can be done by clicking the green button labelled "Clone or download", followed by clicking on the "Download ZIP" on the menu that just appeared. Once downloaded unzip file in desired directory.
-
Navigate to folder 'Bassa-windows' (which should of been created when unzipping the zip file downloaded.) Right click inside the folder, and on the menu, click 'Git Bash here'. If it's not there then you haven't or incorrectly, installed Git (refer to prerequisites).
-
In the Git Bash terminal, type
sh setup.sh
. -
Navigate (in file explorer or CMD) to the folder 'components', then 'core'.
-
Open CMD in that directory (one way to do that is Shift + right click, click 'Open command prompt here')
-
Type and run the command
python setup.py develop
. NOTE If you get the error 'python is not recognized as an internal or external command', generally you must add python to PATH (tutorial here: https://superuser.com/questions/143119/how-to-add-python-to-the-windows-path)
If you get the error: "Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)." You must install Microsoft C++ 10.0 from (https://www.microsoft.com/en-nz/download/details.aspx?id=5555. If this still doesn't work follow this solution on Stack Overflow https://stackoverflow.com/a/34048443/8625593
You can now run the Bassa backend with python Main.py
Furthermore, you can also start the backend as well as the UI, by running one single bat file. (refer to the Automatic Server Start section of this article)
Now if you want a nice looking interface, instead of a boring terminal (sorry terminal), then there are a few extra steps required to install the dependencies.
-
Navigate to the 'bassa-windows' folder (main folder created when unzipping zip file). If you were just following the previous instructions, then you will be inside in the 'components/core' directory. Just click the back button twice (or go up a directory twice) - this should get you to the correct folder.
-
Inside the 'bassa-windows' folder navigate the folder(directory) labeled 'ui' .
-
Open up your CMD prompt inside of the folder (this can be done by SHIFT + right click, 'Open Command Prompt Here'). In the command prompt run the command
npm install
.
If you get an error running npm install
, then you probably haven't installed it. NPM comes bundled with Node.js. So all you have to do is install node.js (from https://nodejs.org/en/), and there you go.
-
Next you must install Bower. In a command prompt type and run
npm install -g bower
(the -g flag installs it globally) -
Install Gulp with
npm install --global gulp
Run Bassa UI with gulp serve
Again, you can also start the backend as well as the UI, by running a bat file. (refer to the Automatic Server Start section of this article)
DB setup and aria2 installation is identical to the other platforms and the instructions can be found on the README
You can either use the bat file to start your server, or you can manually run the commands. There are a total of two commands that have to be run in separate command prompt windows to get it up ad running.
First open a command prompt and navigate to the components/core folder in the repo (the 'cd' command is very useful). Once the working directory for the cmd is in the components/core folder, run python Main.py
. If the command prompt prints out Server initialized for gevent.
then the test server is running and is ready. NOTE.Keep the CMD window open to keep the server from stopping.
Next open a new command prompt, and navigate to the ui/ folder in the repo (again 'cd' command is useful). Once the working directory for the cmd windows is the ui/ folder, run 'gulp serve. If it is functioning correctly then you should see an output of text. It should begin with
[09:53:11] Using gulpfile ~\Documents\Coding\Bassa-master\ui\gulpfile.js` Remember the time (the [09:53:11]) will vary as well as the directory part, depending on where you put the repo.
If using the chrome browser, for me it opens a new tab which has it's url set to localhost:3000
. If this doesn't happen for you look at the cmd window where you ran gulp serve
. There should be a line that looks something like [BS] Local URL: http://localhost:3000/
copy and paste the url into your browser of choice. It should load onto the Bassa login screen.
Inside the repo there is a bat file which if ran will automatically run the commands python Main.py
and gulp serve
-
starting the core and ui modules of Bassa. For each of these commands it will open a new cmd window. To start the server just double click the file, and a cmd window should pop up. Now if you receive no errors then the window will say SUCCESSFULLY STARTED UI
and SUCCESSFULLY STARTED TEST SERVER
.
Now there are a few errors that may occur before it starts the ui and test server. If you receive a message beginning and ending with a line of asterisks (*), then that unfortunately means that there is an error. This is because before starting the server the bat file tests for the dependencies. It does this by basically running the cmd command for that program (for example if python is installed, the command python
should not return any errors.) With each error there will be an explanation on how to fix it. All of the errors suggest that you download (if you haven't already) the program that cannot be ran. Because the program checks to see if something is installed by just running the CMD command, this means that the program's .exe file may exist somewhere on the HDD but it will still give an error because the directory of the .exe is not in the PATH environment variable. The PATH environment variable is where CMD will look for the application you have asked to run through the command prompt. This saves time as the computer knows where to look for it. A tutorial on how to add application to path: https://msdn.microsoft.com/en-us/library/office/ee537574(v=office.14).aspx .
If you get an error from the gulp server
ui cmd, or the 'python Main.py` test server cmd, then it is an issue regarding the server itself. Double check on dependencies as the .bat file currently doesn't check all of them (refer to 'For developers' section for the list of dependencies it currently checks).
Currently the .bat file checks for the following dependencies (if any are added please add them here):
- Python
- NodeJS
- NPM (which should be bundled with nodejs)
- Gulp
If you get an error like python: can't open file 'components/core/Main.py': [Errno 2] No such file or directory
or The system cannot find the path specified.
then files have been changed inside the repo. To understand these errors we need to look at the code:
start cmd /k "ECHO Python Test Server & python components/core/Main.py"
This line starts the python test server. The start cmd /k
part opens a new cmd window and anything following - surrounded with speech quotes, will be ran. The ECHO Python Test Server
is not very important, what is important is the python components/core/Main.py
. The 'python' part calls the Python.exe. Following the keyword 'python' is the directory to the python file that you want python.exe to run. However if Main.py
is moved then the components/core/Main.py
is incorrect, which produces the error python: can't open file 'components/core/Main.py': [Errno 2] No such file or directory
. To fix this change it to the correct directory of Main.py.
START cmd /k "ECHO Frontend Node Module & cd ui & gulp serve"
Again this line opens a cmd and ECHO's a line to it, but the important part is the cd ui
. This changes the working directory for the cmd to run the command gulp serve
('cd' stands for 'change directory'). If the ui components are moved to a different directory then change the target directory for the 'cd' command. If the command is not changed then you may get the error: The system cannot find the path specified.