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