forked from RainingComputers/whipFTP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_dependencies.py
75 lines (70 loc) · 2.65 KB
/
install_dependencies.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
#!/usr/bin/env python3
#Dependencies to be installed:
# pramiko
# psutil (v3.4.2 for win XP)
# pypiwin32 (219 for win XP)
import os
import platform
import sys
#Check if pip is installed
try:
import pip
except ImportError:
print('Please install pip. Failed to install dependencies.')
input('Press enter to continue...')
exit()
#if Windows
if(platform.system() == 'Windows'):
print('Platform: Windows ' + platform.release())
python_path = sys.executable
if(python_path.split('\\')[-1:][0] == 'pythonw.exe'):
print('Do not run this from IDLE. Double click the script to run it directly from python.exe')
input('Press enter to continue...')
exit()
#if Windows 7/10
if(platform.release() != 'XP' and platform.release() != '2003Server'):
print('Upgrading pip...')
os.system(python_path + ' -m pip install --upgrade pip')
print('Installing pramiko...')
os.system(python_path + ' -m pip install paramiko')
print('Installing psutil...')
os.system(python_path + ' -m pip install psutil')
print('Installing pypiwin32...')
os.system(python_path + ' -m pip install pypiwin32')
input('Press enter to continue...')
else:
#if Windows XP
print('Upgrading pip...')
os.system(python_path + ' -m pip install --upgrade pip')
print('Installing pramiko...')
os.system(python_path + ' -m pip install paramiko')
print('Installing psutil...')
os.system(python_path + ' -m pip install psutil==3.4.2')
print('Installing pypiwin32...')
os.system(python_path + ' -m pip install pypiwin32==219')
input('Press enter to continue...')
#if Linux
elif(platform.system() == 'Linux'):
print('Platform: Linux')
print('Upgrading pip...')
os.system('python3 -m pip install --upgrade pip --user')
print('Installing pramiko...')
os.system('python3 -m pip install paramiko --user')
print('Installing psutil...')
os.system('python3 -m pip install psutil --user')
input('Press enter to continue...')
#if FreeBSD
elif(platform.system() == 'FreeBSD'):
if(os.geteuid() != 0):
print('You need to have root privileges to run this script.')
input('Press enter to continue...')
print('Platform: FreeBSD')
print('Upgrading pip...')
os.system('python3.6 -m pip install --upgrade pip')
print('Installing tkinter...')
os.system('pkg install py36-tkinter-3.6.5_6')
print('Installing pramiko...')
os.system('python3.6 -m pip install paramiko')
print('Installing psutil...')
os.system('python3.6 -m pip install psutil')
input('Press enter to continue...')