No module named pip.req

后端 未结 6 1638
轮回少年
轮回少年 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条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 14:32

    It looks like it would work if you had this code:

    def parse_requirements(filename):
        """ load requirements from a pip requirements file """
        lineiter = (line.strip() for line in open(filename))
        return [line for line in lineiter if line and not line.startswith("#")]
    

    Do this:

    1. create a directory pip/
    2. add an empty file pip/__init__.py
    3. add a file pip/req.py
    4. put the code above into pip/req.py:
    5. modify the line in setup.py

      reqs = install_reqs

提交回复
热议问题