optimalsetup.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:of 作者: OptimalBPM 项目源码 文件源码
def check_prerequisites():
    if major == 2:
        raise Exception("\nERROR RUNNING INSTALLATION:\n"
                        "You are running the setup with Python " + str(major) + "." + str(minor) + "." + str(
            micro) + "!\n"
                     "Please install Python version 3.4 or higher and run with that version instead (python3 optimalsetup.py)")

    if major == 3 and minor < 4:
        _pythonversion = str(major) + "." + str(minor) + "." + str(micro)

        try:
            print("Python " + _pythonversion + " found, so checking if pip is installed..")
            import pip
            print("it was, continuing..")
        except ImportError:
            print("it wasn't, checking if easy_install is installed..")
            try:

                from setuptools.command import easy_install
                if minor == 3:
                    print("it was, installing pip..")
                    easy_install.main(["pip"])
                else:
                    print("it was, installing pip 7.1.2 because 8.x isn't compatible with 3.0-3.2..")
                    easy_install.main(["pip==7.1.2"])
            except ImportError:
                print("it wasn't, halting installation, raising error.")
                raise Exception("Error RUNNING INSTALLATION:\n"
                                "You are running the setup with Python " + _pythonversion + "!\n"
                                                                                            "It doesn't have pip package management installed as default and this installation failed to install it automatically.\n"
                                                                                            "PLease check the pip web site for instructions for your platform:\n"
                                                                                            "https://pip.pypa.io/en/stable/installing/")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号