-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_packages.py
39 lines (32 loc) · 1.24 KB
/
install_packages.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
35
36
37
38
39
# -*- coding: utf-8 -*-
from os import path, mkdir, getcwd
import pip
import requests
def install_scikit_image():
"""
As we have unofficial wheel support for Scikit
image library for windows.
It's installed from github location
:return:
"""
package = r"scikit_image-0.13.0-cp27-cp27m-win_amd64.whl"
si_url = str("https://github.com/Veerendram/"
"thirdpary_packages_internal/raw/master/{}").format(package)
print "Downloading scikit image: {}".format(si_url)
print "getcwd: {}".format(getcwd())
download_location = "{}\downloads".format(getcwd())
save_file_as = "{}\{}".format(download_location, package)
if not path.isfile(path.join(download_location, package)):
if not path.isdir(download_location):
mkdir(download_location)
# urlretrieve(url=si_url, filename=save_file_as)
print "downloading with requests"
r = requests.get(si_url)
with open(save_file_as, "wb") as dwnld:
dwnld.write(r.content)
print "Installing {}".format(save_file_as)
cmd = save_file_as
pip.main(['install', cmd, '--upgrade', '--force-reinstall',
'--no-cache-dir', '--no-deps'])
if __name__ == '__main__':
install_scikit_image()