Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 15abddf

Browse files
authored
Remove tensorflow and CloudML SDK from setup.py (#144)
* Install TensorFlow 0.12.1. * Remove TensorFlow and CloudML SDK from setup.py. * Add comments why we ignore errors when importing mlalpha.
1 parent 220d804 commit 15abddf

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

datalab/kernel/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,21 @@
3131
import datalab.bigquery.commands
3232
import datalab.context.commands
3333
import datalab.data.commands
34-
import datalab.mlalpha.commands
3534
import datalab.stackdriver.commands
3635
import datalab.storage.commands
3736
import datalab.utils.commands
3837

38+
# mlalpha modules require TensorFlow, CloudML SDK, and DataFlow (installed with CloudML SDK).
39+
# These are big dependencies and users who want to use Bigquery/Storage features may not
40+
# want to install them.
41+
# This __init__.py file is called when Jupyter/Datalab loads magics on startup. We don't want
42+
# Jupyter+pydatalab fail to start because of missing TensorFlow/DataFlow. So we ignore import
43+
# errors on mlalpha commands.
44+
try:
45+
import datalab.mlalpha.commands
46+
except:
47+
print('TensorFlow and CloudML SDK are required.')
48+
3949

4050
_orig_request = _httplib2.Http.request
4151
_orig_init = _requests.Session.__init__

setup.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -109,24 +109,3 @@
109109
]
110110
}
111111
)
112-
113-
# for python2 only, install tensorflow and cloudml
114-
if sys.version_info[0] == 2:
115-
tensorflow_path = None
116-
if platform.system() == 'Darwin':
117-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl'
118-
elif platform.system() == 'Linux':
119-
if platform.linux_distribution()[0] == 'Ubuntu':
120-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
121-
elif platform.linux_distribution()[0] == 'Debian':
122-
tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/debian/jessie/tensorflow-0.11.0-cp27-none-linux_x86_64.whl'
123-
124-
# install tensorflow
125-
if not tensorflow_path:
126-
print("""Warning: could not find tensorflow build for your OS.
127-
Please go to https://www.tensorflow.org/get_started/os_setup to see install options""")
128-
else:
129-
pip.main(['install', tensorflow_path])
130-
131-
# install cloud ml sdk
132-
pip.main(['install', 'https://storage.googleapis.com/cloud-ml/sdk/cloudml.latest.tar.gz'])

0 commit comments

Comments
 (0)