I have never encountered your problem before. But you can turn the program into a service, so it will not be killed when the shell exits. The simplest way to create a service is to use supervisor, which is also implemented in python under Linux.
===== To add, there is a relatively simple way to use the screen command. For example:
screen -S xyz (Choose a memorable name) python xxx.py (start your program) ctrl+a+d Then just exit. After logging in next time, execute:
screen -r xyz You can return to the interface you last exited
I have encountered the same situation. If the test can run, it means that the code is correct. According to the error message: The specified module cannot be found in the currently running python version. The most likely cause is a version conflict. In order to ensure that the correct python version is running, it is best to It’s as simple as running the absolute path The classmate who asked for advice also asked me to compile alias npy3=nohup python-absolute-path
virtualenv
Have you sourced it? before nohupI have never encountered your problem before.
But you can turn the program into a service, so it will not be killed when the shell exits. The simplest way to create a service is to use supervisor, which is also implemented in python under Linux.
=====
To add, there is a relatively simple way to use the screen command. For example:
screen -S xyz (Choose a memorable name)
python xxx.py (start your program)
ctrl+a+d
Then just exit.
After logging in next time, execute:
screen -r xyz
You can return to the interface you last exited
Looks like an environment variable issue
This looks like an environment variable problem.
It’s really impossible to write a fork function and turn it into a daemon process.
I have encountered the same situation. If the test can run, it means that the code is correct.
According to the error message: The specified module cannot be found in the currently running python version. The most likely cause is a version conflict.
In order to ensure that the correct python version is running, it is best to It’s as simple as running the absolute path
The classmate who asked for advice also asked me to compile alias npy3=nohup python-absolute-path