2

I am trying to test simple script to get Wi-Fi information. I installed the python-Wi-Fi module to use it, but once I run the script I get this message error:

File "C:\Users\PC\Anaconda2\lib\site-packages\pythonwifi\iwlibs.py",

line 28, in

import fcntl ImportError: No module named fcntl

Any ideas?

Thanks

Community
  • 1
  • 1
M aisha
  • 49
  • 1
  • 1
  • 2

3 Answers3

1

If you read the description from python-wifi on pip you'll see the Operating System it's POSIX & Linux, that's why you're having problems in the first place, they didn't write portable code and just stick to linux.

Therefore, either you make work that library on windows following the comment's duplicated posts (which could take you time) or you just find something more suitable for windows like this one.

BPL
  • 9,632
  • 9
  • 59
  • 117
  • 1
    so is there any solution for that ? and by the way i try it on ubuntu still getting the same error message !! – M aisha Aug 14 '16 at 16:00
0

On Windows, it may be better to use win32api calls. However, this will take this time because you need to take each and every function call and find the equivalent to win32api for each of them based on what you want the call to do. Some calls may not even have an equivalent.

If it doesn't have a windows equivalent, you would need to change the api of the module and structure of the program.

Source: nosklo's answer at this question

Marvin
  • 853
  • 2
  • 14
  • 38
0
  • As per we know fcntl is not support on windows.
  • So we can use the sub system of ubuntu. follow the below link and you can access the windows directories.

https://ubuntu.com/tutorials/ubuntu-on-windows#4-install-ubuntu-for-windows-10