@@ -182,29 +182,33 @@ try {
182182 Write-Host " Setting up backend Conda environment..." - ForegroundColor Cyan
183183
184184 # Remove existing environment (ignore if it does not exist)
185- conda remove - n backend_env -- all - y
185+ conda remove - p .env -- all - y
186186 if ($LASTEXITCODE -ne 0 ) {
187187 Write-Host " Environment did not exist or could not be removed, continuing..." - ForegroundColor Yellow
188188 }
189189
190190 # Create fresh environment
191- conda create - n backend_env python= 3.12 - y
191+ conda create - p .env python= 3.12
192192 if ($LASTEXITCODE -ne 0 ) {
193193 throw " Failed to create Conda environment"
194194 }
195195
196+ conda activate .\.env
197+
196198 # Upgrade pip inside the environment
197- conda run - n backend_env python - m pip install -- upgrade pip
199+ python - m pip install -- upgrade pip
198200 if ($LASTEXITCODE -ne 0 ) {
199201 throw " Failed to upgrade pip inside Conda environment"
200202 }
201203
202204 # Install backend dependencies
203- conda run - n backend_env python - m pip install - r requirements.txt
205+ pip install - r requirements.txt
204206 if ($LASTEXITCODE -ne 0 ) {
205207 throw " Failed to install backend dependencies"
206208 }
207-
209+
210+ # Deactivate environment after setup
211+ conda deactivate
208212 Set-Location ..
209213
210214 Write-Host " Backend setup completed successfully." - ForegroundColor Green
@@ -221,29 +225,32 @@ try {
221225 Write-Host " Setting up sync-microservice Conda environment..." - ForegroundColor Cyan
222226
223227 # Remove existing environment (ignore if it does not exist)
224- conda remove - n sync_env -- all - y
228+ conda remove - p . sync-env -- all - y
225229 if ($LASTEXITCODE -ne 0 ) {
226230 Write-Host " Environment did not exist or could not be removed, continuing..." - ForegroundColor Yellow
227231 }
228232
229233 # Create fresh environment
230- conda create - n sync_env python= 3.12 - y
234+ conda create - p . sync-env python= 3.12
231235 if ($LASTEXITCODE -ne 0 ) {
232236 throw " Failed to create Conda environment for sync-microservice"
233237 }
234238
239+ conda activate .\.sync-env
240+
235241 # Upgrade pip inside the environment
236- conda run - n sync_env python - m pip install -- upgrade pip
242+ python - m pip install -- upgrade pip
237243 if ($LASTEXITCODE -ne 0 ) {
238244 throw " Failed to upgrade pip in sync_env"
239245 }
240246
241247 # Install dependencies inside the environment
242- conda run - n sync_env python - m pip install - r requirements.txt
248+ conda install - r requirements.txt
243249 if ($LASTEXITCODE -ne 0 ) {
244250 throw " Failed to install sync-microservice dependencies"
245251 }
246-
252+ # Deactivate environment after setup
253+ conda deactivate
247254 Set-Location ..
248255
249256 Write-Host " Sync-microservice setup completed successfully." - ForegroundColor Green
0 commit comments