Luigi管道:Windows中没有名为pwd的模块

2024-09-21 02:59:44 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试执行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模块。在

^{pr2}$

我正在使用python3.6在Anaconda Spyder中工作


Tags: 模块andhttps程序comdatawithpwd
3条回答

这里的基本问题是luigid background试图生成一个python守护进程,这是一个特定于unix的东西。在

请参阅此处标题为“luigid服务器”的部分:http://luigi.readthedocs.io/en/stable/central_scheduler.html

具体来说:

Note that this requires python-daemon. By default, the server starts on AF_INET and AF_INET6 port 8082 (which can be changed with the port flag) and listens on all IPs. (To use an AF_UNIX socket use the unix-socket flag)

此现有堆栈溢出答案提供了更多详细信息:

How to start daemon process from python on windows?

我在这里看到的选项有:

  1. 在github上用Luigi记录一个请求,以改进windows支持,从而将Luigid作为后台交换机的windows进程
  2. 在Windows上运行一个带有适当Unix操作系统的虚拟机,并在那里运行Luigi管道。在
  3. 按照Steven G的建议,在单独的命令提示符下运行luigid

要重现此问题的根本原因,请在windows中打开python提示符并键入:

>>import daemon

Traceback (most recent call last): File "", line 1, in File "C:\Anaconda3\lib\site-packages\daemon__init__.py", line 42, in from .daemon import DaemonContext File "C:\Anaconda3\lib\site-packages\daemon\daemon.py", line 25, in import pwd ModuleNotFoundError: No module named 'pwd'

因为某些原因,不要在后台使用它

只需在cmd中写入luigid

我可以通过安装python daemon==2.1.2来解决这个问题 如果已经有python守护程序,请尝试将其降级到2.1.2版本 安装luigi之前请执行此操作。在

示例: pip install python daemon==2.1.2 然后 pip安装luigi。在

相关问题 更多 >

    热门问题