This repository was archived by the owner on Sep 3, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-22
lines changed Expand file tree Collapse file tree 2 files changed +11
-22
lines changed Original file line number Diff line number Diff line change 31
31
import datalab .bigquery .commands
32
32
import datalab .context .commands
33
33
import datalab .data .commands
34
- import datalab .mlalpha .commands
35
34
import datalab .stackdriver .commands
36
35
import datalab .storage .commands
37
36
import datalab .utils .commands
38
37
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
+
39
49
40
50
_orig_request = _httplib2 .Http .request
41
51
_orig_init = _requests .Session .__init__
Original file line number Diff line number Diff line change 109
109
]
110
110
}
111
111
)
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' ])
You can’t perform that action at this time.
0 commit comments