AttributeError: Module Pip has no attribute 'main'

后端 未结 16 1439
滥情空心
滥情空心 2020-11-29 00:53

I am trying to build the python api for an open source project called Zulip and I keep running into the same issue as indicated by the screenshot below.

I am running

16条回答
  •  囚心锁ツ
    2020-11-29 01:29

    It appears that pip did a refactor and moved main to internal. There is a comprehensive discussion about it here: https://github.com/pypa/pip/issues/5240

    A workaround for me was to change

    import pip
    pip.main(...)
    

    to

    from pip._internal import main
    main(...)
    

    I recommend reading through the discussion, I'm not sure this is the best approach, but it worked for my purposes.

提交回复
热议问题