Skip to content
Snippets Groups Projects
Select Git revision
  • 47c688b49340b510c6250d5e7caeb8f660de9582
  • master default
  • object
  • develop protected
  • private_algos
  • cuisine
  • SMOTE
  • revert-76c4cca5
  • archive protected
  • no_graphviz
  • 0.0.2
  • 0.0.1
12 results

Versions.py

Blame
  • Baptiste Bauvin's avatar
    Baptiste Bauvin authored
    9d3a3e6d
    History
    Versions.py 1.89 KiB
    # Author-Info
    __author__ = "Baptiste Bauvin"
    __status__ = "Prototype"  # Production, Development, Prototype
    
    
    def testVersions():
        """Used to test if all prerequisites are installed"""
        isUpToDate = True
        toInstall = []
    
        try:
            import sys
        except ImportError:
            raise
    
        try:
            import cvxopt
        except ImportError:
            isUpToDate = False
            toInstall.append("cvxopt")
    
        try:
            import pyscm
        except ImportError:
            isUpToDate = False
            toInstall.append("pyscm")
    
        try:
            import numpy
        except ImportError:
            isUpToDate = False
            toInstall.append("numpy")
    
        try:
            import scipy
        except ImportError:
            isUpToDate = False
            toInstall.append("scipy")
    
        try:
            import matplotlib
        except ImportError:
            isUpToDate = False
            toInstall.append("matplotlib")
    
        try:
            import sklearn
        except ImportError:
            isUpToDate = False
            toInstall.append("sklearn")
    
        try:
            import logging
        except ImportError:
            isUpToDate = False
            toInstall.append("logging")
    
        try:
            import joblib
        except ImportError:
            isUpToDate = False
            toInstall.append("joblib")
    
        try:
            import argparse
        except ImportError:
            isUpToDate = False
            toInstall.append("argparse")
    
        try:
            import h5py  #
        except ImportError:
            isUpToDate = False
            toInstall.append("h5py")
    
        # try:
        #     import graphviz  #
        # except ImportError:
        #     isUpToDate = False
        #     toInstall.append("graphviz")
    
        try:
            import pickle  #
        except ImportError:
            isUpToDate = False
            toInstall.append("pickle")
    
        if not isUpToDate:
            print("You can't run at the moment, please install the following modules : \n"+ "\n".join(toInstall))
            quit()
    
    if __name__== "__main__":
        testVersions()