forked from ISC-Lab/T4Train
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
104 lines (92 loc) · 4.23 KB
/
setup.py
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python3
# ============================================================================
"""
setup.py is a file for the first set of setting up T4Train and is dependencies.
It upgrades pip and then installs PyAudio for Windows. PyAudio is installed in
requirements.txt for MacOS & Linux.
"""
# ============================================================================
import os
from sys import platform
if platform == 'darwin':
conda_version = os.popen("conda --version").read().split(' ')[1]
if conda_version.startswith("23"):
print('Good job, you have conda correctly installed! ('+conda_version[:-1]+') \n')
else:
print("Install conda per the instructions.")
exit()
python_version = os.popen("python --version").read().split(' ')[1]
if python_version.startswith("3.9"):
print('Good job, you have the correct python version! ('+python_version[:-1]+') \n')
else:
print("Install python per the instructions.")
exit()
brew_version = os.popen("brew --version").read().split(' ')[1].split('\n')[0]
if brew_version.startswith("3.6"):
print('Good job, you have brew correctly installed! ('+brew_version[:-1]+') \n')
print("Installing portaudio \n")
os.system("brew install portaudio")
else:
print("Install brew per the instructions")
exit()
print("Upgrading pip\n")
os.system("pip install --upgrade pip")
print("Instaling requirements")
os.system("pip install --upgrade --force-reinstall -r requirements.txt")
print("Installing pyaudio separately for Macs")
os.system("pip install --upgrade --force-reinstall pyaudio")
if platform.startswith('win'):
conda_version = os.popen("conda --version").read().split(' ')[1]
if conda_version.startswith("23"):
print('Good job, you have conda correctly installed! ('+conda_version[:-1]+') \n')
else:
print("Install conda per the instructions.")
exit()
python_version = os.popen("python --version").read().split(' ')[1]
if python_version.startswith("3.9"):
print('Good job, you have the correct python version! ('+python_version[:-1]+') \n')
else:
print("Install python per the instructions.")
exit()
print("Upgrading pip\n")
os.system("pip install --upgrade pip")
print("Instaling requirements")
os.system("pip install --upgrade --force-reinstall -r requirements.txt")
print("Installing pyaudio separately for Windows")
os.system("pip install --user readme_assets\PyAudio-0.2.11-cp39-cp39-win_amd64.whl")
if platform.startswith('linux'):
conda_version = os.popen("conda --version").read().split(' ')[1]
if conda_version.startswith("23"):
print('Good job, you have conda correctly installed! ('+conda_version[:-1]+') \n')
else:
print("Install conda per the instructions.")
exit()
python_version = os.popen("python --version").read().split(' ')[1]
if python_version.startswith("3.9"):
print('Good job, you have the correct python version! ('+python_version[:-1]+') \n')
else:
print("Install python per the instructions.")
exit()
print("Upgrading pip\n")
os.system("pip install --upgrade pip")
print("Instaling requirements")
os.system("pip install --upgrade --force-reinstall -r requirements.txt")
print("Installing pyaudio separately for Linux")
os.system("pip install --upgrade --force-reinstall pyaudio")
# upgrading pip
# os.system("python -m pip install --user --upgrade pip")
# os.system("pip install --user -r requirements.txt")
# os.system("echo ~")
# os.system("echo ~")
# os.system("echo ~")
# os.system("echo ~")
# os.system("echo ~")
# os.system("echo = = = = = = = = = = = = = = = = = = = = = = =")
# os.system("echo Installing pyaudio...")
# if platform == "win32":
# os.system("echo You are using Windows, WHY?? WHHHHYYYYYY????")
# os.system("pip install --user readme_assets\PyAudio-0.2.11-cp39-cp39-win_amd64.whl")
# else:
# os.system("echo You are using Linux, GOOD BOIII!!!")
# os.system("pip install --user pyaudio")
# os.system("echo = = = = = = = = = = = = = = = = = = = = = = =")