-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_app.ps1
More file actions
26 lines (20 loc) · 743 Bytes
/
run_app.ps1
File metadata and controls
26 lines (20 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
Set-Location $Root
$VenvDir = Join-Path $Root '.venv'
$Python = Join-Path $VenvDir 'Scripts\python.exe'
if (-not (Test-Path $Python)) {
Write-Host "Creating virtual environment in $VenvDir"
py -3 -m venv $VenvDir
}
Write-Host "Installing requirements..."
& $Python -m pip install --upgrade pip
& $Python -m pip install -r (Join-Path $Root 'requirements.txt')
Write-Host "Launching Streamlit in a separate window..."
$args = @(
'-m', 'streamlit', 'run', 'app.py',
'--server.port', '8501',
'--server.address', 'localhost'
)
Start-Process -FilePath $Python -ArgumentList $args -WorkingDirectory $Root