我收到以下错误:
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/