-
Notifications
You must be signed in to change notification settings - Fork 10
/
upgrade_mkl.py
29 lines (22 loc) · 1.39 KB
/
upgrade_mkl.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
from sys import executable
import platform
import subprocess
# Custom OS-specific installation script
def install_MKL_dependencies():
#-----------------------------------------------------------------------
if platform.system() != 'Windows':
raise SystemError('MKL dependencies are only available on Windows systems.')
subprocess.run([executable,'-m','pip','uninstall','numpy','-y'],check=False)
subprocess.run([executable,'-m','pip','uninstall','scipy','-y'],check=False)
subprocess.run([executable,'-m','pip','uninstall','cvxopt','-y'],check=False)
# At the moment the dependencies must be handled manually this way
subprocess.run([executable,'-m','pip','install','git+https://github.com/luisfabib/pipwin'],check=False)
# Install Numpy,SciPy, CVXopt linked to MKL from Gohlken's repository
subprocess.run([executable,'-m','pipwin','install','numpy','--filter=mkl','--user'],check=False)
subprocess.run([executable,'-m','pipwin','install','scipy','--user'],check=False)
subprocess.run([executable,'-m','pipwin','install','cvxopt','--user'],check=False)
#-----------------------------------------------------------------------
if __name__ == "__main__":
print("Installing MKL-linked packages from the Gohlke repository...")
install_MKL_dependencies()
print("Finished installing MKL-linked packages from the Gohlke repository.")