Skip to content

Instantly share code, notes, and snippets.

@fovtran
Created June 16, 2020 17:16
Show Gist options
  • Save fovtran/e4082c7b67006e5124cbde0e18574920 to your computer and use it in GitHub Desktop.
Save fovtran/e4082c7b67006e5124cbde0e18574920 to your computer and use it in GitHub Desktop.
Pip automated installs
import pip
def install(package):
pip.main(['install --force', package])
try:
import requests
except:
install('requests==2.23.0')
try:
import numpy
except:
install('numpy==1.18.5')
try:
import scipy
except:
install('scipy==1.4.1')
try:
import pandas
except:
install('pandas==1.0.4')
try:
import statsmodels
except:
install('statsmodels==0.10.2')
try:
import sympy
except:
install('sympy==1.6')
try:
import matplotlib
except:
install('matplotlib==3.2.1')
try:
import ipython
except:
install('ipython')
#install('sklearn')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment