-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_textharvester.ps1
More file actions
38 lines (32 loc) · 1.44 KB
/
Copy pathstart_textharvester.ps1
File metadata and controls
38 lines (32 loc) · 1.44 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
# PowerShell script to start TextHarvester
Write-Host "Starting TextHarvester application..." -ForegroundColor Green
# Change to the TextHarvester directory
Set-Location -Path "$PSScriptRoot\TextHarvester"
# Try to activate the conda environment if it exists
if (Test-Path "$env:USERPROFILE\anaconda3\condabin\conda.bat") {
Write-Host "Activating Anaconda environment..." -ForegroundColor Yellow
& "$env:USERPROFILE\anaconda3\condabin\conda.bat" activate prodigy_env
} elseif (Test-Path "$env:USERPROFILE\miniconda3\condabin\conda.bat") {
Write-Host "Activating Miniconda environment..." -ForegroundColor Yellow
& "$env:USERPROFILE\miniconda3\condabin\conda.bat" activate prodigy_env
}
# Check if python is available
try {
$pythonVersion = python --version
Write-Host "Using Python: $pythonVersion" -ForegroundColor Cyan
# Start the application
Write-Host "Starting main.py..." -ForegroundColor Green
python main.py
} catch {
Write-Host "Python command not found, trying python3..." -ForegroundColor Yellow
try {
$python3Version = python3 --version
Write-Host "Using Python3: $python3Version" -ForegroundColor Cyan
# Start the application with python3
python3 main.py
} catch {
Write-Host "ERROR: Python not found. Please make sure Python is installed and in your PATH." -ForegroundColor Red
Read-Host "Press Enter to exit"
}
}
Read-Host "Press Enter to exit"