Hi rajsekhar,
Sorry for responding to your message nearly 2 months late. Haven't got notified for the messages from Linuxcnc forum. I guess I need to configure the notification settings correctly.
What it looks like is a Python specific problem. Python as you might know is a little bit local installation dependent. In my own early days with Python I had a very hard time understanding why "apt-get"-ing python could not really "install" the latest python on Ubuntu. Turns out it had something to do with how your `python` or `python2` command is linked to the specific location in your filesystem. To troubleshoot your situation, I might be looking at the following things:
1. The first line of the python code "#!/usr/bin/env python2" is called a shebang line, and it specifies a specific python interpreter used for executing the code. That is, the "python2" binary from the "/usr/bin/env" folder. You might want to look around /usr/bin/env folder and see what specific python2 binary is installed there. It might be absent or being a lower version than you might expect.
2. check your PATH in the command line console. Do this by using command "echo $PATH" and you will get a string like "/bin:/user/bin:/folder/subfolder:/folder2/subfolder2". This is a search path with the colon symbol ":" serving as separators. The search is performed from the left to right. Say in this example PATH, you have a 2.7.3 python2 in the /bin folder, and a 2.7.16 python2 in the /user/bin folder, and you issue a command "python2". What is going to happen is that python 2.7.3 will be invoked, because it is sitting in the leftmost folder. There are methods to modify PATH. For example, use `alias` or `export PATH=/folder/containing/new/python:$PATH`. Note that these two methods are not permanent, and only last until you exit your current shell. To make the changes permanent, you might need to append a line to your ~/.bashrc, or ~/.bash_profiles file, which gets executed automatically every time you invoke shell.
3. To debug, one thing that might be helpful would be printing out the version of your python interpreter at run-time. do so by inserting `import sys`, and then `print(sys.version)` somewhere in the code, probably at the beginning.
4. To "update Python version", you can try modify the python shebang line, or modify PATH, and then verify result using method described in #3.
5. The "best practice" to deal with python paths is actually using python virtual environments. You can create virtual environment by using "venv", and use the python interpreter from a local venv folder. Note that you might need to install all required packages to run the code after creating a blank slate venv. Note this method is very similar to how I dealt with Java JDK in the "run.sh" script. From the "run.sh" script, "./jdk1.8.0_291/bin/java -jar AutolevellerAE-0.9.5u2.jar", the first argument specifies using the java run-time environment from that specific folder.
6. Going back to the python code itself, Enum and @unique are used in line #33-40, and @unique is really just a good practice property wrapper that prevents you from assigning two Enum's to the same number. Commenting out @unique should not break the code.