linux - 直接python程序运行没有问题,nohup运行就出错了,该怎么解决啊?
伊谢尔伦
伊谢尔伦 2017-04-18 09:24:27
0
5
881
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all (5)
迷茫

virtualenvHave you sourced it? before nohup

    Peter_Zhu

    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

      小葫芦

      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

            Latest Downloads
            More>
            Web Effects
            Website Source Code
            Website Materials
            Front End Template
            About us Disclaimer Sitemap
            php.cn:Public welfare online PHP training,Help PHP learners grow quickly!