Dealing with multiple Python versions and PIP?

后端 未结 23 2819
走了就别回头了
走了就别回头了 2020-11-21 06:58

Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my s

23条回答
  •  北荒
    北荒 (楼主)
    2020-11-21 07:23

    This is probably the completely wrong thing to do (I'm a python noob), but I just went in and edited the pip file

    #!/usr/bin/env python3 <-- I changed this line.
    
    # -*- coding: utf-8 -*-
    import re
    import sys
    
    from pip._internal import main
    
    if __name__ == '__main__':
        sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
        sys.exit(main())
    

提交回复
热议问题