10
0
mirror of https://github.com/LCPQ/EMSL_Basis_Set_Exchange_Local synced 2024-10-31 19:23:42 +01:00

Reput pip install request

This commit is contained in:
Thomas Applencourt 2015-01-12 14:22:13 +01:00
parent 038b89645d
commit 50216ccaf2

View File

@ -19,6 +19,29 @@ for i in data:
dict_ele[l[1].strip().lower()] = l[2].strip().lower()
def install_with_pip(name):
ins = False
d = {'y': True,
'n': False}
while True:
choice = raw_input('Do you want to install it ? [Y/N]')
try:
ins = d[choice.lower()]
break
except:
print "not a valid choice"
if ins:
try:
import pip
pip.main(['install', name])
except:
print "You need pip, (http://pip.readthedocs.org/en/latest/installing.html)"
sys.exit(1)
def cond_sql_or(table_name, l_value):
l = []
@ -36,7 +59,12 @@ class EMSL_dump:
self.format = format
self.contraction = str(contraction)
try:
import requests
except:
print "You need the requests package"
install_with_pip("requests")
finally:
self.requests = requests
def set_db_path(self, path):