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

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

问题描述

我收到以下错误:

回溯(最近一次调用最后一次):文件C:/Users/aaaa/Desktop/ttttttt.py",第 5 行,在 <module> 中导入重新加载文件C:UsersaaaAppDataLocalProgramsPythonPython36libsite-package
eload.py",第 3 行,在 <module> 中导入系统、时间、重新、操作系统、信号、fcntlModuleNotFoundError: 没有名为fcntl"的模块

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

 C:Usersaaaa>pip install fcntl收集 fcntl找不到满足 fcntl 要求的版本(来自版本:)找不到与 fcntl 匹配的分布

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

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

我该如何解决?

#py3导入时间从硒导入网络驱动程序导入编解码器导入系统导入重新加载进口重新进口fcntl导入操作系统输入信号

解决方案

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

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

I get the following error:

Traceback (most recent call last):
  File "C:/Users/aaaa/Desktop/ttttttt.py", line 5, in <module>
   import reload
  File "C:UsersaaaAppDataLocalProgramsPythonPython36libsite-
packages
eload.py", line 3, in <module>
    import sys, time, re, os, signal, fcntl
ModuleNotFoundError: No module named 'fcntl'

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

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

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.

How should I solve it?

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

解决方案

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

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天全站免登陆