Purge_Registres_D-c-s_INSEE/install.py

53 lines
1.6 KiB
Python

import sys
import subprocess
try:
import peewee
except ImportError:
print("Installing peewee")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "peewee"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())
try:
import requests
except ImportError:
print("Installing requests")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "requests"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())
import requests
try:
import browser_cookie3
except ImportError:
print("Installing browser_cookie3")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "browser_cookie3"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())
try:
import pandas
except ImportError:
print("Installing pandas")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "pandas"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())
try:
import xlrd
except ImportError:
print("Installing xlrd")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "xlrd"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())
try:
import numpy
except ImportError:
print("Installing numpy")
p = subprocess.Popen([sys.executable, "-m", "pip", "install", "-U", "numpy"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print(p.communicate())