11diff --git a/python/tensorboard/tensorboard b/python/tensorboard/tensorboard
2- index 11825cb..ff9cef8 100755
2+ index 11825cb..83db229 100755
33--- a/python/tensorboard/tensorboard
44+++ b/python/tensorboard/tensorboard
5- @@ -7,6 +7,7 @@ import shutil
5+ @@ -7,11 +7,15 @@ import shutil
66 import sys
77 import subprocess
88 import zipfile
99+ import site
1010
1111 # Return True if running on Windows
1212 def IsWindows():
13- @@ -37,7 +38,12 @@ def FindPythonBinary():
13+ return os.name == 'nt'
14+
15+ + # get Python version
16+ + PY3 = sys.version_info[0] == 3
17+ +
18+ PYTHON_BINARY = '/Users/zihao.zzh/anaconda2/envs/tensorboard-test/bin/python'
19+ if IsWindows() and not PYTHON_BINARY.endswith('.exe'):
20+ PYTHON_BINARY = PYTHON_BINARY + '.exe'
21+ @@ -37,7 +41,15 @@ def FindPythonBinary():
1422 'Bazel does not support execution of Python interpreters via labels yet')
1523 elif PYTHON_BINARY.startswith('/'):
1624 # Case 2: Absolute path.
@@ -20,11 +28,14 @@ index 11825cb..ff9cef8 100755
2028+ return PYTHON_BINARY
2129+ else:
2230+ # not exist, have to search. often occurs in travis-built wheel.
23- + return SearchPath('python')
31+ + if PY3:
32+ + return SearchPath('python3')
33+ + else:
34+ + return SearchPath('python')
2435 elif '/' in PYTHON_BINARY:
2536 # Case 3: Path is relative to current working directory.
2637 return os.path.join(os.getcwd(), PYTHON_BINARY)
27- @@ -58,6 +64 ,18 @@ def FindModuleSpace():
38+ @@ -58,6 +70 ,18 @@ def FindModuleSpace():
2839 module_space = stub_filename + '.runfiles'
2940 if os.path.isdir(module_space):
3041 break
@@ -38,8 +49,8 @@ index 11825cb..ff9cef8 100755
3849+ package_path.extend(user_path)
3950+ for mod in package_path:
4051+ module_space = mod + '/tensorboard/tensorboard' + '.runfiles'
41- + if os.path.isdir(module_space):
42- + return module_space
52+ + if os.path.isdir(module_space):
53+ + return module_space
4354
4455 runfiles_pattern = "(.*\.runfiles)/.*"
4556 if IsWindows():
0 commit comments