Skip to content

Commit

Permalink
tf2: Updated setup.py dependencies. (#1002)
Browse files Browse the repository at this point in the history
* Updated setup.py dependencies.

* Allow tf2 baselines pip package setup to work with all tf2 cpu/gpu versions.
  • Loading branch information
pisiiki authored and pzhokhov committed Oct 25, 2019
1 parent d1a05a0 commit 713f1a0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
'filelock',
'pytest',
'pytest-forked',
'atari-py'
'atari-py~=0.2.0'
],
'bullet': [
'pybullet',
'pybullet'
],
'mpi': [
'mpi4py'
Expand All @@ -32,8 +32,7 @@
packages=[package for package in find_packages()
if package.startswith('baselines')],
install_requires=[
'tf-nightly-2.0-preview',
'gym',
'gym<0.14',
'scipy',
'tqdm',
'joblib',
Expand All @@ -50,3 +49,14 @@
author_email='[email protected]',
version='0.1.5')

# ensure there is some tensorflow build with version above 2.0
import pkg_resources
tf_pkg = None
for tf_pkg_name in ['tensorflow', 'tensorflow-gpu', 'tf-nightly', 'tf-nightly-gpu']:
try:
tf_pkg = pkg_resources.get_distribution(tf_pkg_name)
except pkg_resources.DistributionNotFound:
pass
assert tf_pkg is not None, 'TensorFlow needed, of version above 2.0'
from distutils.version import LooseVersion
assert LooseVersion(re.sub(r'-?rc\d+$', '', tf_pkg.version)) >= LooseVersion('2.0.0')

0 comments on commit 713f1a0

Please sign in to comment.