python runs differently with nohup
Your shell (probably bash) has an alias assigned so that whenever you type
python at the beginning of a command, it changes that to
/usr/bin/python3. It's hard for me to say why you have that alias. It might be that your system administrator wants everyone to use Python 3 instead of Python 2 by default and this was an attempt to accomplish that.
/usr/bin/python is a symbolic link to a Python 2 binary. This seems pretty normal; it is common on a lot of Linux distributions (such as Debian) for
python to refer to Python 2, because Python 3 is not popular enough yet. That is not always the case though; on Arch Linux,
python refers to Python 3.
So, if I had to guess, I would say that the package manager of your system installed the symbolic link from
/usr/bin/python2.7 because its policy is for people to use Python 2 by default. But someone else who had some say in configuring your system decided that they want Python 3 to be used by default, so they installed this alias.
As you can see, the alias does not work all the time. When you type
nohup python, the shell does not expand your alias and instead just passes the string
python as an argument to the
nohup command. The
nohup command then has to figure out what
python means, and all it does is look on your PATH; it does not know about your shell aliases. It will find
/usr/bin/python and end up running Python 2 for you.
You can read the manual of your shell to find out what files it runs on startup (e.g. .bashrc and things like that). This will help you find out why your shell has that alias for Python 3. Look for a line like this:
You can read about the system's package manager to figure out how to look at what files belong to which packages, and that could help you figure out why there is a symbolic link for Python 2. Just ask the package manager which package owns the