Python Intstallation Checks

python --version
python3 --version
Python 3.9.12
Python 3.9.12
function PythonInstallationCheck () {
    printf "Checking python version\n"
    if [[ $(python3 --version) ]]; then
        py3version=$(python3 --version | cut -d" " -f2)
            printf "     - Python version $py3version has already been installed"
    else
        printf "Python not found"
    fi
}

PythonInstallationCheck
Checking python version
     - Python version  has already been installed

Java Installation Checks

function JavaInstallationCheck () {
    printf "Checking java version\n"
    if [[ $(java --version) ]]; then
        javaversion=$(java --version | cut -d" " -f2)
            printf "     - Java version $javaversion has already been installed\n"
    else
        printf "Java not found\n"
    fi
}

function JavaCInstallationCheck () {
    printf "Checking javaC version\n"
    if [[ $(javac --version) ]]; then
        javacversion=$(javac --version | cut -d" " -f2)
            printf "     - JavaC version $javacversion has already been installed\n"
    else
        printf "JavaC not found\n"
    fi
}

JavaInstallationCheck
JavaCInstallationCheck
Checking java version
     - Java version 11.0.16
Runtime
64-Bit has already been installed
Checking javaC version
     - JavaC version 11.0.16 has already been installed

Anaconda

Anaconda Installation Checks

function AnacondaInstallationCheck () {
    printf "Checking anaconda version\n"
    if [[ $(conda --version) ]]; then
        anacondaversion=$(conda --version | cut -d" " -f2)
            printf "     - anaconda version $anacondaversion has already been installed"
    else
        printf "Anaconda not found"
    fi
}

AnacondaInstallationCheck
Checking anaconda version
     - anaconda version 4.13.0 has already been installed

Anaconda Package Installation Check

function AnacondaPackageCheck () {
    printf "Checking Anaconda package version\n"
    if [[ $(conda list | grep $1) ]]; then
        anacondapackageversion=$(conda list | grep $1 | awk '{print $2}')
        printf "     - Conda package $1 version $anacondapackageversion has already been installed"
    else
        printf "     - Conda Package not found"
    fi
}

AnacondaPackageCheck "nodejs"
Checking Anaconda package version
     - Conda package nodejs version 6.11.2 has already been installed

Jupyter

Jupyter Kernels Check

function JupyterKernelsCheck () {
    printf "Checking jupyter kernel installation"
    if [[ $(jupyter kernelspec list | grep $1) ]]; then
        kernelpath=$(jupyter kernelspec list | grep $1 | awk '{print $2}')
        printf "     - Jupyter $1 kernel has been found at $kernelpath"
    else
        printf "     - Jupyter $1 kernel not found"
    fi
}

kernels="bash javascript python3"
for i in $kernels; do
    JupyterKernelsCheck $1
done
Checking jupyter kernel installationUsage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Traceback (most recent call last):
  File "/home/chewyboba10/anaconda3/bin/jupyter-kernelspec", line 10, in <module>
    sys.exit(KernelSpecApp.launch_instance())
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 266, in start
    return self.subapp.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 54, in start
    print("Available kernels:")
BrokenPipeError: [Errno 32] Broken pipe
     - Jupyter  kernel not foundChecking jupyter kernel installationUsage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Traceback (most recent call last):
  File "/home/chewyboba10/anaconda3/bin/jupyter-kernelspec", line 10, in <module>
    sys.exit(KernelSpecApp.launch_instance())
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 266, in start
    return self.subapp.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 54, in start
    print("Available kernels:")
BrokenPipeError: [Errno 32] Broken pipe
     - Jupyter  kernel not foundChecking jupyter kernel installationUsage: grep [OPTION]... PATTERNS [FILE]...
Try 'grep --help' for more information.
Traceback (most recent call last):
  File "/home/chewyboba10/anaconda3/bin/jupyter-kernelspec", line 10, in <module>
    sys.exit(KernelSpecApp.launch_instance())
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 266, in start
    return self.subapp.start()
  File "/home/chewyboba10/anaconda3/lib/python3.9/site-packages/jupyter_client/kernelspecapp.py", line 54, in start
    print("Available kernels:")
BrokenPipeError: [Errno 32] Broken pipe
     - Jupyter  kernel not found