From 3900f2a4473ce6b26a8129372ca8d5e02c766c9c Mon Sep 17 00:00:00 2001 From: pzhokhov Date: Tue, 21 Aug 2018 16:51:37 -0700 Subject: [PATCH] baselines issue 146 (remove tensorflow from setup.py) (#34) * baselines does not reinstall tensorflow * fix the version check in baselines/setup.py * replace print and assert with assert, str (thanks @csh) --- Dockerfile | 1 + setup.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1d432f3..a7c71bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ WORKDIR $CODE_DIR/baselines # Clean up pycache and pyc files RUN rm -rf __pycache__ && \ find . -name "*.pyc" -delete && \ + pip install tensorflow && \ pip install -e .[test] diff --git a/setup.py b/setup.py index 286cea3..431b062 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,6 @@ setup(name='baselines', 'progressbar2', 'mpi4py', 'cloudpickle', - 'tensorflow>=1.4.0', 'click', 'opencv-python' ], @@ -43,3 +42,12 @@ setup(name='baselines', url='https://github.com/openai/baselines', author_email='gym@openai.com', version='0.1.5') + + +# ensure there is some tensorflow build with version above 1.4 +try: + from distutils.version import StrictVersion + import tensorflow + assert StrictVersion(tensorflow.__version__) >= StrictVersion('1.4.0') +except ImportError: + assert False, "TensorFlow needed, of version above 1.4"