-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependencies.py
34 lines (29 loc) · 946 Bytes
/
dependencies.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import subprocess
import sys
import os
from typing import Callable, Any
import pandas as pd
import logging
import requests
from requests.auth import HTTPBasicAuth
import datetime as dt
# ===================
# pandarallel import
# ===================
def install_pandarallel():
try:
import pandarallel
except ImportError:
response = input("Pandarallel is not installed. Would you like to install it via pip? (yes/no): ").strip().lower()
if response in ['yes', 'y']:
print("Installing pandarallel...")
subprocess.check_call([sys.executable, "-m", "pip", "install", "pandarallel"])
print("Pandarallel has been installed.")
else:
print("Pandarallel was not installed.")
install_pandarallel()
try:
from pandarallel import pandarallel
pandarallel.initialize(progress_bar=True, verbose=0)
except ImportError:
print("Pandarallel is not available.")