-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathinit_env.sh
More file actions
48 lines (39 loc) · 1.26 KB
/
init_env.sh
File metadata and controls
48 lines (39 loc) · 1.26 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
39
40
41
42
43
44
45
46
47
48
conda env create -f envs.yml
conda activate WAM-Diff
#!/bin/bash
# log file for failed installations
FAIL_LOG="failed_packages.log"
# rm existing log file
> $FAIL_LOG
while IFS= read -r line; do
# skip empty lines and comments
if [[ -z "$line" || "$line" =~ ^# ]]; then
continue
fi
echo "====================================="
echo "Installing: $line"
echo "====================================="
# Execute installation command
pip install $line $PIP_MIRROR
# Check if installation was successful
if [ $? -ne 0 ]; then
echo "Installation failed: $line" >> $FAIL_LOG
echo "====================================="
echo "⚠️ $line installation failed, logged to $FAIL_LOG"
echo "====================================="
else
echo "====================================="
echo "✅ $line installed successfully"
echo "====================================="
fi
sleep 1
done < "requirements.txt"
echo "====================================="
echo "Installation complete!"
if [ -s $FAIL_LOG ]; then
echo "❌ The following packages failed to install:"
cat $FAIL_LOG
else
echo "✅ All packages installed successfully!"
fi
echo "====================================="