python - 错误 : No module named 'fcntl'

标签 python windows python-3.x module compiler-errors

我收到以下错误:

Traceback (most recent call last):
  File "C:/Users/aaaa/Desktop/ttttttt.py", line 5, in <module>
   import reload
  File "C:\Users\aaa\AppData\Local\Programs\Python\Python36\lib\site-
packages\reload.py", line 3, in <module>
    import sys, time, re, os, signal, fcntl
ModuleNotFoundError: No module named 'fcntl'

所以我做了一个 pip 安装,它也得到了一个错误。

    C:\Users\aaaa>pip install fcntl
    Collecting fcntl
      Could not find a version that satisfies the requirement fcntl (from versions: )
No matching distribution found for fcntl

搜索结果cPython、hacking、routing等很多词都出来了。

这对初学者来说是一个艰难的答案,所以我想得到更详细的解决方案。

我该如何解决?

#py3
import time
from selenium import webdriver
import codecs
import sys
import reload
import re
import fcntl
import os
import signal

最佳答案

fcntl 模块在 Windows 上不可用。它公开的功能在该平台上不存在。

如果您尝试锁定文件,可以使用其他一些提供该功能的 Python 模块。我在其他答案中看到的一个是 portalocker .

关于python - 错误 : No module named 'fcntl' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45228395/

相关文章:

python - 在 Pandas 中,如果较小,如何将当前行项目设置为上一个?

c++ - 如何在 C++ 中为特定适配器调用 Win32_NetworkAdapterConfiguration::EnableDHCP()?

windows - 如何从命令行中删除系统驱动器中的所有文件夹

python - Pandas - 在 Pandas 中分解多个列并根据分解的列分配值

python - 如何在python中使用datetime模块获取第一秒和最后一秒?

python - OCaml mod 函数返回与 % 不同的结果

c# - 如何将文本框数据导出到excel文件?

python - Django - 当有人通过 PayPal 付款时调用函数

python - Pandas 值(value)错误: invalid literal for int() with base 10: ''

python - 计算每组中 NaN 的数量