pip失败,出现AttributeError:“模块"对象没有属性“包装" [英] pip fails with AttributeError: 'module' object has no attribute 'wraps'

查看:142
本文介绍了pip失败,出现AttributeError:“模块"对象没有属性“包装"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Fedora.我最近将系统从F20升级到F21. Pip在F20上运行正常,但升级到F21后一定出了点问题. Pip停止工作,每当我输入命令pip <anything>时,都会发生以下错误:

I'm on Fedora. I recently upgraded my system from F20 to F21. Pip was working fine on F20 but after the upgrade to F21 something must have gone wrong. Pip stopped working, every time I enter the command pip <anything> the error below occurs:

Traceback (most recent call last):
  File "/usr/bin/pip", line 7, in <module>
    from pip import main
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 12, in <module>
    from pip.commands import commands, get_summaries, get_similar_commands
  File "/usr/lib/python2.7/site-packages/pip/commands/__init__.py", line 6, in <module>
    from pip.commands.bundle import BundleCommand
  File "/usr/lib/python2.7/site-packages/pip/commands/bundle.py", line 6, in <module>
    from pip.commands.install import InstallCommand
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 5, in <module>
    from pip.req import InstallRequirement, RequirementSet, parse_requirements
  File "/usr/lib/python2.7/site-packages/pip/req/__init__.py", line 3, in <module>
    from .req_install import InstallRequirement
  File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 31, in <module>
    from pip.utils import (
  File "/usr/lib/python2.7/site-packages/pip/utils/__init__.py", line 59, in <module>
    def rmtree(dir, ignore_errors=False):
  File "/usr/lib/python2.7/site-packages/pip/_vendor/retrying.py", line 47, in wrap
    @six.wraps(f)
AttributeError: 'module' object has no attribute 'wraps'

推荐答案

好,在尝试了所有我可以用google搜索的解决方案之后,看不到结果.我试着冒险并玩一点.这可能不是最安全的解决方案,但对我来说效果很好. 看到python get-pip.py导致:

Okay after trying out all the solutions I could google with no result in sight. I tried to risk and play a little bit. This might not be the safest solution but it worked fine for me. Seeing that python get-pip.py resulted in:

Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages

即使我卸载了pip也是如此. 我转到/usr/lib/python2.7/site-packages/找出两个pip目录: pip pip-6.0.8.dist-info .立即删除两者.然后再次尝试.瞧!它奏效了.

even when I had pip uninstalled. I went over to /usr/lib/python2.7/site-packages/ to find out two pip directories: pip and pip-6.0.8.dist-info. Removed both immediately. Then tried python get-pip.py again. Voila! it worked.

这篇关于pip失败,出现AttributeError:“模块"对象没有属性“包装"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆