This guide will help you get the PCA Small Web App up and running on your computer, even if you’re new to programming. Just follow these steps carefully!
Python is the programming language this app is built with. You need to install it first. If you think python may be already installed, skip ahead to step 3 and try to verify the installation.
The docs here use
pythonfor Python related commands. On MacOS/Linux devices you’d typically usepython3instead ofpythonfor all python related commands
.exe file. IMPORTANT: Make sure to check the box that says “Add Python X.Y to PATH” during installation. Then, click “Install Now”..pkg file and follow the on-screen instructions. Python is often pre-installed on macOS, but it’s good to install the latest version.sudo apt-get install python3.x for Ubuntu/Debian or sudo dnf install python3.x for Fedora).python --version and press Enter. You should see something like Python 3.10.12 (the version number might be different). If you see an error, Python might not be installed correctly or added to your system’s PATH.The “Terminal” (or “Command Prompt” / “PowerShell”) is where you’ll type commands to run the app.
cd "/path/to/your/GaitVision-main/PCA Small Web App"
Note for Windows users: Your path will look different, e.g.,
cd "C:\Users\YourUser\Desktop\GaitVision-main\PCA Small Web App".
💡 Pro Tip: How to Copy a File Path
- On macOS: Right-click on a file or folder, hold down the
Optionkey, and select “Copy [item name] as Pathname”.- On Windows: Hold down the
Shiftkey and right-click on a file or folder, then select “Copy as path”.You can then paste this path directly into the terminal after typing
cd. Ensure you provide quotes around the file path as well.
A virtual environment keeps the app’s dependencies separate from other Python projects on your computer. This is good practice.
python -m venv venv
venv inside your project folder.Activate the Virtual Environment:
Now, activate the environment based on your operating system.
For simplicity, we recommend using Command Prompt for the following steps.
.\venv\Scripts\activate
.\venv\Scripts\Activate.ps1
Note: If you get an error using PowerShell, you may need to run it as an Administrator and execute the command
Set-ExecutionPolicy RemoteSigned. Using Command Prompt is often easier.
In your terminal, run:
source venv/bin/activate
(venv) will appear at the beginning of your Terminal prompt.Now you need to install all the specific libraries the app needs to run.
(venv) in your prompt), type the following command and press Enter:
pip install -r requirements.txt
Almost there! Now you can start the app.
(venv) activated), type:
python app.py
Open Your Web Browser: Open Chrome, Firefox, Edge, Safari, or any web browser you prefer.
Go to the Address: In the address bar of your web browser, type or paste the address you saw in the Terminal (e.g., http://127.0.0.1:5000) and press Enter.
To stop the application, go back to the Terminal window where it’s running and press Ctrl + C (hold down the Control key and press C). To exit the virtual environment, simply type deactivate and press Enter.
command not found (e.g., python): This usually means Python was not added to your system’s PATH. When installing, make sure to check the box that says “Add Python to PATH”.
pip install fails: