错误:没有名为"fcntl"的模块 [英] Error: No module named 'fcntl'

查看:1427
本文介绍了错误:没有名为"fcntl"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

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安装,这也会出现错误.

So I did a pip install, which also gets an error.

    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,黑客,路由和许多其他词.

Search results cPython, hacking, routing and many other words are coming out.

对于初学者来说,这是一个艰难的答案,因此,我想获得更详细的解决方案.

It's a tough answer for beginners, so I want to get a more detailed solution.

我应该如何解决?

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

推荐答案

fcntl模块在Windows上不可用.该平台所不具备的功能.

The fcntl module is not available on Windows. The functionality it exposes does not exist on that platform.

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

If you're trying to lock a file, there are some other Python modules available which provide that functionality. One I've seen referenced in other answers is portalocker.

这篇关于错误:没有名为"fcntl"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆