没有名为"fcntl"的模块,尝试安装 Pyinstaller



我想安装Pyinstaller来分发我的python脚本,而不需要共享源代码。从我在网上看到的情况来看,fcntl是一个Linux库,这很奇怪,因为Pyinstaller用于制作在Windows上运行的.exe文件。以下是我在使用pip install pyinstaller时遇到的错误。

ModuleNotFoundError: No module named 'fcntl'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

注意:我还没有包括完整的错误。提前谢谢。

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

您可以使用类似portallocker模块的替代方案。经过一番研究,我发现fcntl在windows上的替代品是win32api调用。

最新更新