-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
51 lines (40 loc) · 1.42 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
"""
Author: Blake McBride ([email protected])
Created: 12/08/2023
Overview: This file defines a script to install all the dependencies for this project
"""
# import standard modules
import subprocess
import sys
# define system requirements
REQUIRED_MAJOR = 3
REQUIRED_MINOR = 12
LINK = ""
def checkPythonVersion():
"""
Verifies that the user has the correct version of Python installed
"""
major, minor = list(sys.version_info)[:2]
if major != REQUIRED_MAJOR or minor != REQUIRED_MINOR:
print(f"This script requires Python {REQUIRED_MAJOR}.{REQUIRED_MINOR}.")
print(f"You are using Python {major}.{minor}. Please run this script with Python {REQUIRED_MAJOR}.{REQUIRED_MINOR}.")
print(f"You can download Python {REQUIRED_MAJOR}.{REQUIRED_MINOR} at: {LINK}")
sys.exit(1)
def installDependencies():
"""
Installs all of the dependencies in requirements.txt
"""
with open('config/requirements.txt', 'r') as file:
packages = [line.strip() for line in file if line.strip()]
file.close()
for package in packages:
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
def getNLTKPackages():
import nltk
nltk.download('stopwords')
nltk.download('wordnet')
nltk.download('punkt')
if __name__ == '__main__':
checkPythonVersion()
installDependencies()
getNLTKPackages()