【发布时间】:2018-06-08 20:55:27
【问题描述】:
我正在尝试使用 Anaconda IPython 的“nohup”命令运行代码。 如果我在 ipython 环境中运行它,我的代码运行良好(几个小时);
irsacf00-debian:~/WISE_AP> ipython
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: %run WISE_PHOT_052918_MODULER_IRSACF.py
但是,当我尝试使用“nohup”运行相同的代码时,它会出现以下错误消息(最后 2 行)。这是从输出文件复制粘贴的。
[[0;31mOSError^[[0m: [Errno 5] Input/output error
In [2]: Do you really want to exit ([y]/n)?
我的 nohup 命令如下所示;
irsacf00-debian:~/WISE_AP> nohup ipython <input_file> output_file &
我的输入文件是这样的;
%run /home/aprakash/WISE_AP/WISE_PHOT_052918_MODULER_IRSACF.py
我无法弄清楚代码卡在哪里。感谢您的帮助!
最好, 阿比
【问题讨论】:
-
你的 python 脚本是否从终端读取任何内容?
-
我对你的要求有点困惑,我确实在脚本中有一些子进程和打印语句。像这样; subprocess.run(['rm','-f','/home/aprakash/WISE_AP/url_list_dir_W1/merge_p1bm_frm']) subprocess.run(['rm','-f','/home/aprakash/WISE_AP/ url_list_dir_W2/merge_p1bm_frm']) #!rm -rf {url_list_dir_w1}/* #!rm -rf {url_list_dir_w2}/* print(i) print("图像和蒙版已移除。下一组将被下载用于下一个 AGN 位置")
标签: linux python-3.x anaconda nohup