-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathInstallPythonPrerequisites.command
More file actions
79 lines (70 loc) · 1.79 KB
/
InstallPythonPrerequisites.command
File metadata and controls
79 lines (70 loc) · 1.79 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
75
76
77
78
79
#!/bin/bash
python --version > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "Error: Python is not installed"
exit 1
fi
python --version 2>&1 | grep -q "3.6"
if [[ ! $? -eq 0 ]]; then
python --version 2>&1 | grep -q "2.7"
if [[ ! $? -eq 0 ]]; then
echo "Error: Wrong version of Python detected. 2.7.x or 3.6.x required"
exit 1
fi
fi
echo "Python installed. Checking required modules..."
python -c "import pip" > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "Module pip not installed. Using easy_install"
echo -n "Testing configparser... "
python -c "import configparser" > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "not installed. Installing..."
easy_install --user -U configparser
if [[ ! $? -eq 0 ]]; then
echo "Error: Python failed installing configparser"
exit 1
fi
else
echo "already installed!"
fi
echo -n "Testing pyobjc... "
python -c "import Cocoa" > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "not installed. Installing..."
easy_install --user -U pyobjc
if [[ ! $? -eq 0 ]]; then
echo "Error: Python failed installing pyobjc"
exit 1
fi
else
echo "already installed!"
fi
echo "Setup successful"
exit 0
fi
echo -n "Testing configparser... "
python -c "import configparser" > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "not installed. Installing..."
python -m pip install --user -U configparser
if [[ ! $? -eq 0 ]]; then
echo "Error: Python failed installing configparser"
exit 1
fi
else
echo "already installed!"
fi
echo -n "Testing pyobjc... "
python -c "import Cocoa" > /dev/null 2>&1
if [[ ! $? -eq 0 ]]; then
echo "not installed. Installing..."
python -m pip install --user -U pyobjc
if [[ ! $? -eq 0 ]]; then
echo "Error: Python failed installing pyobjc"
exit 1
fi
else
echo "already installed!"
fi
echo "Setup successful"