Skip to content

Commit 37322dd

Browse files
committed
This checks the pip version
Issue related with tensorflow/tensorflow/issues/34302 also readthedocs/readthedocs.org/issues/7241
1 parent 7349b48 commit 37322dd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

setup.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from setuptools import setup, find_packages
22
import ctypes
33

4+
# to check pip version
5+
import pkg_resources
6+
7+
48

59
def checkCUDAisAvailable():
610
"""
@@ -36,15 +40,24 @@ def getRequirements():
3640
conditionalRequirements: list
3741
A list of strings containing the pip pkgs.
3842
"""
43+
pipVersion = pkg_resources.require("pip")[0].version
44+
print("\n PIP Version", pipVersion, "\n")
45+
olderPip = pipVersion < "20.0"
46+
3947
cudaLibsOk = checkCUDAisAvailable()
4048

4149
conditionalRequirements = []
4250
if cudaLibsOk:
4351
conditionalRequirements += ["tensorflow-gpu==1.15.3", ]
4452
else:
4553
print("\n CUDA it's not available in your machine.")
46-
print(" You won't be able to use the GPU support.\n")
47-
conditionalRequirements += ["tensorflow==1.15.3", ]
54+
#print(" You won't be able to use the GPU support.\n")
55+
#if olderPip:
56+
# tfRequirement = "tensorflow @ https://github.com/tensorflow/tensorflow/archive/v1.15.3.zip#egg=tensorflow-v1.15.3"
57+
#else:
58+
tfRequirement = "tensorflow==1.15.3"
59+
60+
conditionalRequirements += [tfRequirement]
4861

4962
return conditionalRequirements
5063

0 commit comments

Comments
 (0)