forked from Azure/azureml-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_conda_version.py
More file actions
28 lines (21 loc) · 787 Bytes
/
check_conda_version.py
File metadata and controls
28 lines (21 loc) · 787 Bytes
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
from distutils.version import LooseVersion
import platform
try:
import conda
except:
print("Failed to import conda.")
print("This setup is usually run from the base conda environment.")
print(
'You can activate the base environment using the command "conda activate base"'
)
exit(1)
architecture = platform.architecture()[0]
if architecture != "64bit":
print("This setup requires 64bit Anaconda or Miniconda. Found: " + architecture)
exit(1)
minimumVersion = "4.7.8"
versionInvalid = LooseVersion(conda.__version__) < LooseVersion(minimumVersion)
if versionInvalid:
print("Setup requires conda version " + minimumVersion + " or higher.")
print('You can use the command "conda update conda" to upgrade conda.')
exit(versionInvalid)