manim/scripts/pycairoinstall.py
2020-07-31 19:32:32 +05:30

69 lines
3.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import platform
import os
import sys
import urllib.request
if "Windows" in platform.system():
# In case the python version is 3.6 and the system is 32-bit, try pycairo1.19.1cp37cp37mwin32.whl version of cairo
if sys.version[:3] == "3.6" and platform.machine() == "x86":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp36-cp36m-win32.whl",
"pycairo-1.19.1-cp36-cp36m-win32.whl",
)
os.system("pip install pycairo-1.19.1-cp36-cp36m-win32.whl")
os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl")
# In case the python version is 3.6 and the system is 64-bit, try pycairo1.19.1cp37cp37mwin32.whl version of cairo
elif sys.version[:3] == "3.6" and platform.machine() == "AMD64":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp36-cp36m-win_amd64.whl",
"pycairo-1.19.1-cp36-cp36m-win_amd64.whl",
)
print("Sucessfully downloaded Cairo for your system")
print("Installing Cairo")
os.system("pip install pycairo-1.19.1-cp36-cp36m-win_amd64.whl")
os.remove("pycairo-1.19.1-cp36-cp36m-win_amd64.whl")
# In case the python version is 3.7 and the system is 32-bit, try pycairo1.19.1cp37cp37mwin32.whl version of cairo
elif sys.version[:3] == "3.7" and platform.machine() == "x86":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp37-cp37m-win32.whl",
"pycairo-1.19.1-cp37-cp37m-win32.whl",
)
print("Sucessfully downloaded Cairo for your system")
print("Installing Cairo")
os.system("pip install pycairo-1.19.1-cp37-cp37m-win32.whl")
os.remove("pycairo-1.19.1-cp37-cp37m-win32.whl")
# In case the python version is 3.7 and the system is AMD64, try pycairo-1.19.1-cp37-cp37m-win_amd64.whl version of cairo
elif sys.version[:3] == "3.7" and platform.machine() == "AMD64":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp37-cp37m-win_amd64.whl",
"pycairo-1.19.1-cp37-cp37m-win_amd64.whl",
)
print("Sucessfully downloaded Cairo for your system")
print("Installing Cairo")
os.system("pip install pycairo-1.19.1-cp37-cp37m-win_amd64.whl")
os.remove("pycairo-1.19.1-cp37-cp37m-win_amd64.whl")
# In case the python version is 3.8 and the system is 32-bit, try pycairo-1.19.1-cp38-cp38-win32.whl version of cairo
elif sys.version[:3] == "3.8" and platform.machine() == "x86":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp38-cp38-win32.whl",
"pycairo-1.19.1-cp38-cp38-win32.whl",
)
print("Sucessfully downloaded Cairo for your system")
print("Installing Cairo")
os.system("pip install pycairo-1.19.1-cp38-cp38-win32.whl")
os.remove("pycairo-1.19.1-cp38-cp38-win32.whl")
# In case the python version is 3.8 and the system is AMD64, try pycairo-1.19.1-cp38-cp38-win_amd64.whl version of cairo
elif sys.version[:3] == "3.8" and platform.machine() == "AMD64":
urllib.request.urlretrieve(
"https://download.lfd.uci.edu/pythonlibs/w3jqiv8s/pycairo-1.19.1-cp38-cp38-win_amd64.whl",
"pycairo-1.19.1-cp38-cp38-win_amd64.whl",
)
print("Sucessfully downloaded Cairo for your system")
print("Installing Cairo")
os.system("pip install pycairo-1.19.1-cp38-cp38-win_amd64.whl")
os.remove("pycairo-1.19.1-cp38-cp38-win_amd64.whl")