No module named pip.req

后端 未结 6 1639
轮回少年
轮回少年 2020-12-04 13:56

I am installing tweepy, but I am running into an error about pip.req. I have pip installed, but for some reason pip.req still can\'t be found. I did a bunch of research onl

6条回答
  •  旧时难觅i
    2020-12-04 14:48

    This is happening lately because of a change in pip 10.

    The fix is pretty easy. You probably have something like:

    from pip.req import parse_requirements
    

    Change that to something like:

    try: # for pip >= 10
        from pip._internal.req import parse_requirements
    except ImportError: # for pip <= 9.0.3
        from pip.req import parse_requirements
    

    That should do it.

提交回复
热议问题