Assumptions prior to install
- Python 3 is installed and accessible from the path
Run the following commands
- Note that if you are using the fish shell to use "activate.fish" instead of "activate"
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Run the following commands
py -3 -m venv venv
venv\Scripts\activate
pip3 install -r requirements.txt
If you encounter the following error or something similar:
venv\Scripts\activate : File C:\Users\Raymo\Desktop\blah\search-engine\venv\Scripts\Activate.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies
at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ venv\Scripts\activate
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
- Open PowerShell in Administrator mode
- Input this in the prompt
set-executionpolicy remotesigned
- Say yes
Reference: https://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts
Run the following command
deactivate
- You can see your installed requirements from pip using the command
pip freeze
Reference - https://flask.palletsprojects.com/en/1.1.x/quickstart/
- Be in the root directory of the repository when you run these commands
- Note the setting of the FLASK_ENV variable enables debug mode
- The indexes and corpus will NOT be rebuilt when development mode is set
Run the following commands
export FLASK_APP=searchapp/searchapp.py
export FLASK_ENV=development
flask run
Run the following commands
$env:FLASK_APP = "searchapp/searchapp.py"
$env:FLASK_ENV = "development"
flask run
Run the following commands
set FLASK_APP=searchapp/searchapp.py
set FLASK_ENV=development
flask run
Based on: