Stack Exchange
AttributeError: 'module' object has no attribute 'F_GETFD' - Windows 7
I'm having this traceback, lately, everytime I try to run something out of a virtualenv environment into Python 2.7 in windows 7 32bit (Django project, OpenERP v7, etc...)
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 882, in resource_ilename
self, resource_name
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 1351, in get_resorce_filename
self._extract_resource(manager, self._eager_to_zip(name))
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 1382, in _extract resource
outf, tmpnam = _mkstemp(".$extract", dir=os.path.dirname(real_path))
  File "C:\Python27\lib\site-packages\pkg_resources.py", line 2580, in _mkstemp
return mkstemp(*args,**kw)
  File "C:\Python27\lib\tempfile.py", line 304, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
  File "C:\Python27\lib\tempfile.py", line 240, in _mkstemp_inner
_set_cloexec(fd)
  File "C:\Python27\lib\tempfile.py", line 50, in _set_cloexec
flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
  AttributeError: 'module' object has no attribute 'F_GETFD'

I really don't know why is this happening, I've searched through forums with no success.
Does anybody have an idea about this?
Thanks in advance!

Check import fcntl; print fcntl.__file__. There shouldn't be a top-level module named fcntl on Windows. It's for POSIX systems.

I guess I should check that on the project I'm running? Or in C:\Python27 folders?

Ya, indeed, on my openerp there's that import, maybe I should try with the .zip file instead of .tar.gz, thank you!

i am facing same issue in windows 10, python 2.7 on scrapy module.

Delete
C:\Python27\Lib\fcntl.pyc

and rename
fcntl.py

to
fcntl_ex.py

