还安装了cygwin
NameError:未定义名称'fcntl'
Traceback (most recent call last):
File "C:\Users\Smart\AppData\Local\Programs\Python\Python35-32\Scripts\hangups-script.py", line 9, in <module>
load_entry_point('hangups==0.4.1', 'console_scripts', 'hangups')()
File "c:\users\smart\appdata\local\programs\python\python35-32\lib\site-packages\hangups\ui\__main__.py", line 988, in main
}, col_scheme, palette_colors, datetimefmt, notifier
File "c:\users\smart\appdata\local\programs\python\python35-32\lib\site-packages\hangups\ui\__main__.py", line 87, in __init__
event_loop=urwid.AsyncioEventLoop(loop=loop)
File "c:\users\smart\appdata\local\programs\python\python35-32\lib\site-packages\urwid\main_loop.py", line 111, in __init__
screen = raw_display.Screen()
File "c:\users\smart\appdata\local\programs\python\python35-32\lib\site-packages\urwid\raw_display.py", line 89, in __init__
fcntl.fcntl(self._resize_pipe_rd, fcntl.F_SETFL, os.O_NONBLOCK)
NameError: name 'fcntl' is not defined
答案 0 :(得分:2)
您正在使用的代码(或您正在调用的模块)使用fcntl
。
代码中使用标准库中的fcntl模块的有罪模块或行将导致错误,因为此功能仅在Linux上可用。
如果能够找到错误的来源,您可以使用其他功能或模块来解决。
答案 1 :(得分:0)
作为@simonzack pointed out,您需要将Python用于Cygwin。
您可能是从Windows Shell安装的,可能没有为Cygwin安装的Python,或者您的路径中的Windows Python比Cygwin的更早。
在您的shell中执行which
或type
,以确定您调用的Python安装的路径。确保它来自Cygwin路径而不是Windows安装。