我收到以下错误:
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 install,它也得到了一个错误。
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
原文由 yome 发布,翻译遵循 CC BY-SA 4.0 许可协议
fcntl
模块在 Windows 上不可用。它公开的功能在该平台上不存在。如果您尝试锁定文件,还有一些其他 Python 模块可以提供该功能。我在其他答案中看到的一个是
portalocker
。