我正在尝试执行https://marcobonzanini.com/2015/10/24/building-data-pipelines-with-python-and-luigi/中给出的教程。
我可以使用本地调度器独立运行程序,这给了我:
Scheduled 2 tasks of which:
* 2 ran successfully:
- 1 PrintNumbers(n=1000)
- 1 SquaredNumbers(n=1000)
This progress looks :) because there were no failed tasks or missing external de
pendencies
===== Luigi Execution Summary =====但是,为了在服务器上尝试可视化,当我尝试运行luigid --background时,它抛出一个错误,告诉我没有pwd模块。我找不到使用pip for windows的pwd模块。
File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages
\luigi\process.py", line 79, in daemonize
import daemon
File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages
\daemon\__init__.py", line 42, in <module>
from .daemon import DaemonContext
File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages
\daemon\daemon.py", line 25, in <module>
import pwd
ModuleNotFoundError: No module named 'pwd'我使用Python 3.6在Anaconda Spyder中工作
发布于 2018-08-23 01:02:27
我可以通过安装python-daemon==2.1.2来修复这个问题。如果你已经有python-daemon了,试着降级到2.1.2版本,在安装luigi之前这样做。
示例: pip install python-daemon==2.1.2然后pip install luigi。
发布于 2018-07-24 05:54:40
出于某些原因,如果你不在windows上使用--background参数,它会启动的很好
只需在命令中写入luigid即可
发布于 2018-07-27 00:34:39
这里的基本问题是luigid --后台正在尝试产生一个特定于unix的python守护进程。
请参阅标题为“luigid服务器”的部分:http://luigi.readthedocs.io/en/stable/central_scheduler.html
具体地说:
请注意,这需要使用
-daemon。默认情况下,服务器在端口和端口8082 (可以使用-- AF_INET6标志更改)上启动,并侦听所有IP。(要使用套接字,请使用--unix- AF_UNIX标志)
此现有堆栈溢出答案提供了更多详细信息:
How to start daemon process from python on windows?
我在这里看到的选项有:
中运行luigid。
要重现此问题的根本原因,请在windows中打开python提示符,然后键入:
>>import daemon文件回溯(最近一次调用):文件"",第1行,位于文件"C:\Anaconda3\lib\site-packages\daemon__init__.py",第42行,位于.daemon导入DaemonContext文件ModuleNotFoundError行25,位于导入pwd :没有名为'pwd'的模块
https://stackoverflow.com/questions/50486039
复制相似问题