|
13 | 13 | # To publish to PyPi use: python setup.py bdist_wheel upload -r pypi
|
14 | 14 |
|
15 | 15 | import datetime
|
16 |
| -import platform |
| 16 | +import sys |
17 | 17 | from setuptools import setup
|
18 |
| -import pip |
| 18 | + |
| 19 | +if sys.version_info[0] == 2: |
| 20 | + import platform |
| 21 | + import pip |
19 | 22 |
|
20 | 23 | minor = datetime.datetime.now().strftime("%y%m%d%H%M")
|
21 | 24 | version = '0.1.' + minor
|
|
107 | 110 | }
|
108 | 111 | )
|
109 | 112 |
|
110 |
| -tensorflow_path = None |
111 |
| -if platform.system() == 'Darwin': |
112 |
| - tensorflow_path = 'https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0-py2-none-any.whl' |
113 |
| -elif platform.system() == 'Linux': |
114 |
| - if platform.linux_distribution()[0] == 'Ubuntu': |
115 |
| - tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl' |
116 |
| - elif platform.linux_distribution()[0] == 'Debian': |
117 |
| - tensorflow_path = 'https://storage.googleapis.com/tensorflow/linux/cpu/debian/jessie/tensorflow-0.11.0-cp27-none-linux_x86_64.whl' |
| 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' |
118 | 123 |
|
119 |
| -# install tensorflow |
120 |
| -if not tensorflow_path: |
121 |
| - print("""Warning: could not find tensorflow build for your OS. |
122 |
| - Please go to https://www.tensorflow.org/get_started/os_setup to see install options""") |
123 |
| -else: |
124 |
| - pip.main(['install', tensorflow_path]) |
| 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]) |
125 | 130 |
|
126 |
| -# install cloud ml sdk |
127 |
| -pip.main(['install', 'https://storage.googleapis.com/cloud-ml/sdk/cloudml.latest.tar.gz']) |
| 131 | + # install cloud ml sdk |
| 132 | + pip.main(['install', 'https://storage.googleapis.com/cloud-ml/sdk/cloudml.latest.tar.gz']) |
0 commit comments