Error: No module named 'fcntl'

97,130

What you can do is install importlib with the usual:

pip install importlib

From there use the following:

from importlib import reload

Note that you will need to load your imports as 'modules':

from petshop import parrot as parrot
Share:
97,130
yome
Author by

yome

Updated on July 09, 2022

Comments

  • yome
    yome 11 months

    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:\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'
    

    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
    

    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