forked from crynux-network/crynux-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_mac.sh
More file actions
executable file
·74 lines (61 loc) · 1.61 KB
/
setup_mac.sh
File metadata and controls
executable file
·74 lines (61 loc) · 1.61 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# https://github.com/AnyLifeZLB/FaceVerificationSDK/blob/main/install_newest_mediapipe_on_macos.md
export SYSTEM_VERSION_COMPAT=0
# Must use arm64 version of Python
# python > 3.10.2 is required
PYTHON_CMD=""
for cmd in python3 python; do
if command -v "$cmd" &> /dev/null; then
"$cmd" -c "
import sys
version = sys.version_info
if not (version.major == 3 and (version.minor > 10 or (version.minor == 10 and version.micro > 2))):
sys.exit(1)
"
if [ $? -eq 0 ]; then
PYTHON_CMD="$cmd"
break
fi
fi
done
if [ -z "$PYTHON_CMD" ]; then
echo "Python > 3.10.2 is required."
echo "Could not find a compatible python version. Please install python > 3.10.2 and make sure it is in your PATH as 'python' or 'python3'."
exit 1
fi
echo "Using python: $PYTHON_CMD"
arch=$($PYTHON_CMD -c "import platform;print(platform.uname())")
if [[ $arch == *"x86_64"* ]]; then
echo "Please use the python in arm64 arch"
exit 1
fi
# remove old env
if [ -d "venv" ]; then
rm -rf venv
fi
if [ -d "worker" ]; then
rm -rf worker
fi
# prepare the server
$PYTHON_CMD -m venv venv
source ./venv/bin/activate
pip install -r requirements_desktop.txt
pip install .
# prepare the worker
mkdir worker
cp crynux-worker/crynux_worker_process.py worker/
cd worker
$PYTHON_CMD -m venv venv
source ./venv/bin/activate
cd ../stable-diffusion-task
pip install -r requirements_macos.txt
pip install .
cd ../gpt-task
pip install -r requirements_macos.txt
pip install .
cd ../crynux-worker
pip install -r requirements.txt
pip install .
# go back to server venv
cd ../
source ./venv/bin/activate