forked from Pyomo/pyomo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyomo_uninstall.py
77 lines (72 loc) · 1.71 KB
/
pyomo_uninstall.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
# ___________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright 2017 National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and
# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain
# rights in this software.
# This software is distributed under the 3-clause BSD License.
# ___________________________________________________________________________
#
# A script to uninstall Coopr, Pyomo and PyUtilib.
#
try:
import pip
except ImportError:
print("You must have 'pip' installed to run this script.")
raise SystemExit
packages = [
'Pyomo',
'Coopr',
'PyUtilib',
'coopr.age',
'coopr.bilevel',
'coopr.core',
'coopr.dae',
'coopr.environ',
'coopr.gdp',
'coopr.misc',
'coopr.mpec',
'coopr.neos',
'coopr.openopt',
'coopr.opt',
'coopr.os',
'coopr.pyomo',
'coopr.pysos',
'coopr.pysp',
'coopr.solvers',
'coopr.sucasa',
'pyutilib.R',
'pyutilib.autotest',
'pyutilib.common',
'pyutilib.component.app',
'pyutilib.component.config',
'pyutilib.component.core',
'pyutilib.component.executables',
'pyutilib.component.loader',
'pyutilib.dev',
'pyutilib.enum',
'pyutilib.excel',
'pyutilib.math',
'pyutilib.misc',
'pyutilib.ply',
'pyutilib.pyro',
'pyutilib.services',
'pyutilib.subprocess',
'pyutilib.svn',
'pyutilib.th',
'pyutilib.virtualenv',
'pyutilib.workflow',
]
print("Uninstalling...")
for package in packages:
try:
pip.main(['uninstall','-y',package])
except:
pass
#
# See https://github.com/pypa/pip/issues/1618 for an
# explanation of this hack. This reset's the logger used by
# pip.
#
pip.logger.consumers = []