[7665698] | 1 | """ |
---|
| 2 | Checking and reinstalling the external packages |
---|
| 3 | """ |
---|
| 4 | import os |
---|
| 5 | import sys |
---|
[b441081] | 6 | |
---|
[7665698] | 7 | if sys.platform =='win32': |
---|
| 8 | IS_WIN = True |
---|
| 9 | else: |
---|
| 10 | IS_WIN = False |
---|
| 11 | try: |
---|
| 12 | import setuptools |
---|
| 13 | print "==> setuptools-%s installed."% setuptools.__version__ |
---|
[b441081] | 14 | if setuptools.__version__ != '0.6c11': |
---|
| 15 | print "!!! Recommend to install 0.6c11." |
---|
[7665698] | 16 | except: |
---|
| 17 | print "!!! setuptools-0.6c11 not installed." |
---|
| 18 | try: |
---|
| 19 | import pyparsing |
---|
[b441081] | 20 | print "==> pyparsing-%s installed."% pyparsing.__version__ |
---|
| 21 | if pyparsing.__version__ != '1.5.5': |
---|
[7665698] | 22 | print "!!! 1.5.5 recommended." |
---|
| 23 | except: |
---|
| 24 | print "==> pyparsing-1.5.5 not installed." |
---|
| 25 | try: |
---|
| 26 | import html5lib |
---|
[b441081] | 27 | print "==> html5lib-%s installed."% html5lib.__version__ |
---|
[7665698] | 28 | if html5lib.__version__.count('0.95') > 0: |
---|
| 29 | print "!!! 0.95 recommended." |
---|
| 30 | except: |
---|
| 31 | print "!!! html5lib-0.95 not installed." |
---|
| 32 | try: |
---|
| 33 | import pyPdf |
---|
[b441081] | 34 | print "==> pyPdf-%s installed."% pyPdf.__version__ |
---|
| 35 | if pyPdf.__version__ != '1.13': |
---|
| 36 | print "!!! 1.13 recommended." |
---|
[7665698] | 37 | except: |
---|
| 38 | print "!!! pyPdf-1.13 not installed (optional)." |
---|
| 39 | try: |
---|
| 40 | import reportlab |
---|
[b441081] | 41 | print "==> reportlab-%s installed."% reportlab.__version__ |
---|
| 42 | if reportlab.__version__ != '2.5': |
---|
| 43 | print "!!! 2.5 recommended" |
---|
[7665698] | 44 | except: |
---|
| 45 | print "!!! reportlab-2.5 not installed." |
---|
| 46 | try: |
---|
| 47 | import lxml |
---|
[b441081] | 48 | print "==> lxml-%s installed."% lxml.__version__ |
---|
| 49 | if lxml.__version__ != '2.3': |
---|
| 50 | print "!!! 2.3 recommended" |
---|
[7665698] | 51 | except: |
---|
| 52 | print "!!! lxml-2.3 not installed." |
---|
| 53 | try: |
---|
[b441081] | 54 | import Image |
---|
| 55 | print "==> PIL-%s installed."% Image.VERSION |
---|
| 56 | if Image.VERSION != '1.1.7': |
---|
| 57 | print "!!! 1.1.7 recommended." |
---|
[7665698] | 58 | except: |
---|
| 59 | print "!!! PIL-1.1.7 not installed." |
---|
| 60 | try: |
---|
| 61 | import pylint |
---|
| 62 | print "==> pylint installed." |
---|
| 63 | except: |
---|
| 64 | print "!!! pylint not installed (optional)." |
---|
| 65 | #os.system("START /B C:\python26\Scripts\easy_install pylint==0.25.0") |
---|
| 66 | try: |
---|
| 67 | import periodictable |
---|
| 68 | print "==> periodictable-%s installed."% periodictable.__version__ |
---|
| 69 | if periodictable.__version__ != '1.3.0': |
---|
| 70 | print "!!! Recommend to install 1.3.0." |
---|
| 71 | except: |
---|
| 72 | print "!!! periodictable-1.3.0 is not installed." |
---|
| 73 | try: |
---|
| 74 | import numpy |
---|
| 75 | print "==> numpy-%s installed."% numpy.__version__ |
---|
| 76 | if numpy.__version__ != '1.6.1': |
---|
| 77 | print "==> Recommend to install 1.6.1 (1.5.1 for MAC)." |
---|
| 78 | except: |
---|
| 79 | print "!!! numpy-1.6.1 not installed (1.5.1 for MAC)." |
---|
| 80 | try: |
---|
| 81 | import scipy |
---|
| 82 | print "==> scipy-%s installed."% scipy.__version__ |
---|
| 83 | if scipy.__version__ != '0.10.1': |
---|
| 84 | print "!!! Recommend to install 0.10.1 (1.10.0 for MAC)." |
---|
| 85 | except: |
---|
| 86 | print "!!! scipy-0.10.1 not installed (1.10.0 for MAC)." |
---|
| 87 | try: |
---|
| 88 | import wx |
---|
| 89 | print "==> wxpython-%s installed."% wx.__version__ |
---|
| 90 | if wx.__version__ != '2.8.12.1': |
---|
| 91 | print "!!! Recommend to install unicode-2.8.12.1." |
---|
| 92 | except: |
---|
| 93 | print "!!! wxpython-unicode-2.8.12.1 not installed." |
---|
| 94 | try: |
---|
| 95 | import matplotlib |
---|
| 96 | print "==> matplotlib-%s installed."% matplotlib.__version__ |
---|
| 97 | if matplotlib.__version__ != '1.1.0': |
---|
| 98 | print "!!! Recommend to install 1.1.0 (1.0.1 for MAC) or higher." |
---|
| 99 | except: |
---|
| 100 | print "!!! matplotlib-1.1.0 not installed (1.0.1 for MAC)." |
---|
| 101 | try: |
---|
| 102 | from ho import pisa |
---|
| 103 | if pisa.__version__ == '3.0.27': |
---|
| 104 | print "==> pisa-%s installed."% pisa.__version__ |
---|
| 105 | else: |
---|
| 106 | print "!!! Incorrect version of pisa installed." |
---|
| 107 | print "!!! 3.0.27 required." |
---|
| 108 | except: |
---|
| 109 | print "!!! pisa-3.0.27 not installed." |
---|
| 110 | if IS_WIN: |
---|
| 111 | try: |
---|
| 112 | import pywin |
---|
| 113 | print "==> pywin32 installed." |
---|
| 114 | except: |
---|
| 115 | print "!!! pywin32 not installed. Please install pywin32-217." |
---|
| 116 | try: |
---|
| 117 | import py2exe |
---|
| 118 | print "==> py2exe-%s installed."% py2exe.__version__ |
---|
| 119 | if py2exe.__version__ != '0.6.9': |
---|
| 120 | print "!!! Recommend to install 0.6.9." |
---|
| 121 | except: |
---|
| 122 | print "!!! py2exe-0.6.9 not installed. Installing..." |
---|
| 123 | try: |
---|
| 124 | import comtypes |
---|
| 125 | print "==> comtypes-%s installed."% comtypes.__version__ |
---|
| 126 | if comtypes.__version__ != '0.6.2': |
---|
| 127 | print "!!! Recommend to install 0.6.2." |
---|
| 128 | except: |
---|
| 129 | print "!!! comtypes-0.6.2 not installed. Installing..." |
---|
| 130 | print "==> Require subversion = 1.6.0 or lower version." |
---|
| 131 | print "Installed:" |
---|
| 132 | os.system("CALL svn --version --quiet") |
---|
| 133 | print "==> Checking gcc compiler ( >= 4.2 required):" |
---|
| 134 | os.system("CALL gcc -v") |
---|
[131576f] | 135 | else: |
---|
| 136 | try: |
---|
| 137 | import py2app |
---|
| 138 | print "==> py2app-%s installed."% py2app.__version__ |
---|
| 139 | except: |
---|
| 140 | print "!!! py2app not installed (optional for MAC bundling." |
---|
| 141 | |
---|