如何解决AttributeError: ‘module‘ object has no attribute ‘F_GETFD‘这个问题?

首先,我目前的Python版本为2.7,在做一个django框架下的项目。但是每次pip一些包或者命令的时候,总会报错:AttributeError: 'module' object has no attribute 'F_GETFD',如下图:

如何解决AttributeError: ‘module‘ object has no attribute ‘F_GETFD‘这个问题?

 很烦人,我是这么解决的,到你项目所依赖的Python环境下的Lib文件夹中,找到fcntl.pyc删除掉,并将fcntl.py重命名为fcntl_ex.py:(当然,这里我是自己创建了一个虚拟环境,我所有的包也都是pip在这一个虚拟环境下)

如何解决AttributeError: ‘module‘ object has no attribute ‘F_GETFD‘这个问题?

最终,这个问题不会再报错了。这个问题就解决了,完结撒花。

 

上一篇:virtualbox的Linux虚拟磁盘大小调整及注意事项


下一篇:最全华为ensp路由器启动失败错误代码40怎么办?