Python Forum
ModuleNotFoundError: No module named 'fcntl'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'fcntl'
#1
I installed bpython quite easily no problem. However whenever i try to run it anything I get this error.

C:\Users\Newport_j\Downloads>bpython --V
Traceback (most recent call last):
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Newport_j\AppData\Local\Programs\Python\Python37\Scripts\bpython.exe\__main__.py", line 4, in <module>
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\bpython\curtsies.py", line 11, in <module>
    import curtsies
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\curtsies\__init__.py", line 4, in <module>
    from .window import FullscreenWindow, CursorAwareWindow
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\curtsies\window.py", line 30, in <module>
    import blessings
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\blessings\__init__.py", line 7, in <module>
    from fcntl import ioctl
ModuleNotFoundError: No module named 'fcntl'

C:\Users\Newport_j\Downloads>bpython
Traceback (most recent call last):
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Newport_j\AppData\Local\Programs\Python\Python37\Scripts\bpython.exe\__main__.py", line 4, in <module>
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\bpython\curtsies.py", line 11, in <module>
    import curtsies
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\curtsies\__init__.py", line 4, in <module>
    from .window import FullscreenWindow, CursorAwareWindow
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\curtsies\window.py", line 30, in <module>
    import blessings
  File "c:\users\newport_j\appdata\local\programs\python\python37\lib\site-packages\blessings\__init__.py", line 7, in <module>
    from fcntl import ioctl
ModuleNotFoundError: No module named 'fcntl'
The error say no module named 'fcntl'.

I am installing and trying to run bpython on Windows 10 Pro 64 bit.

When I google the error it seems to say there is no fix for this. It is a quirk on Windows 10 Pro, so move to Ubuntu where it will work.

Now it also implies on the internet that there is a work around. It seems to be vague on this so maybe the workaround is not universal but just applies in some cases.

So which is it? Is there a reliable workaround for Windows 10 or or not?

Any help appreciated. Thanks in advance.

Respectfully,

ErnestTBass
Reply
#2
Fcntl is a unix/linux interface. Python exposes that interface in the fcntl module. Windows doesn't have that interface.

Everything you do in fcntl can be done in other ways in windows (probably via win32api), but that would be a port, not just some small changes. Using fcntl extensively pretty much means you are excluding windows. This isn't specific to Windows 10 Pro. I would expect any techniques that get this to work on windows (perhaps by disabling the bits that need the fcntl calls) should work on any version of windows.

I see this older SO post on windows bpython. Not sure if you've started there or not... https://stackoverflow.com/questions/5217...windows-10

This does seem to be an uphill climb for trying to run this on windows right now. I'd probably suggest installing WSL on your system to get Ubuntu and running the package there.
Reply
#3
Oaky, thank you. I will switch OS's to Ubuntu.

Respectfully,

ErnestTBass
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 710 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 22,946 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,165 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,313 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,390 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,227 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 963 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 8,208 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 934 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,770 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020