AttributeError:'模块'对象没有属性' F_GETFD' - Windows 7的

时间:2015-02-06 17:47:03

标签: python django windows openerp

最近,每当我尝试在virt7alenv环境中运行某些东西到Windows 7 32bit(Django项目,OpenERP v7等等)的Python 2.7中时,我都有这种追溯。

  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'

我真的不知道为什么会这样,我在论坛上搜索没有成功。

有人对此有所了解吗?

提前致谢!

1 个答案:

答案 0 :(得分:1)

删除

C:\Python27\Lib\fcntl.pyc

并重命名

fcntl.py

fcntl_ex.py