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/")
评论列表
文章目录