Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Windows PyPI support and installer script test #23

Open
zihaolucky opened this issue Mar 6, 2017 · 6 comments
Open

Windows PyPI support and installer script test #23

zihaolucky opened this issue Mar 6, 2017 · 6 comments

Comments

@zihaolucky
Copy link
Member

zihaolucky commented Mar 6, 2017

As we have Win users, I'm going to:

  • Test the installer.sh script under Windows.
  • Try to build PyPI for Windows.
  • Possibility to provide an anaconda version.

As I haven't used windows for a while, it might take some time. Anyone could help and contribute in this direction?

@zihaolucky
Copy link
Member Author

@ahmedezzateasa Just follow this issue and we're looking for your feedback.

@ahmedezzat85
Copy link

ahmedezzat85 commented Mar 27, 2017

@zihaolucky I can successfully run the installer.sh on Windows 10.

System Description

Windows 10 x64
Visual Studio Community 2015
Anaconda 2 (for python 2.7)
bazel 0.4.5
MSYS 2

Build Steps

I followed the steps in README . These are the steps with some Details:

Install Protocol Buffer 3

  1. Download the windows version (the latest is protoc-3.2.0-win32.zip) and extract it to a folder with no spaces (e.g. C:\protoc-win32).
  2. Add the protocol buffer bin dir (C:/protoc-win32/bin) to windows PATH.

Install MS Visual Studio Community Edition

bazel requires visual studio to be installed. There is a free edition "Visual Studio Community" for open source development. I am using 2015 version, 2017 also will be OK.
Create a C Hello World example to check there is no missing packages and the installation is OK.
You need to install Windows SDK for Windows 8 (within the installation of Visual Studio).

Install bazel for windows

The best method to install bazel is to use chocolatey package manager for windows. The steps are:

  1. Install Anaconda. Use 64-bit installer for python 2.7.
  • Install for current user only to avoid permission issues.
  • Select the installation root directory to be C:/Anaconda2 (to avoid spaces).
  • Make it the default system python2.7.
  1. Install chocolatey (Follow this link).
  • Use Windows PowerShell as Administrator.
  • Execute Set-ExecutionPolicy Unrestricted
  1. Run "choco install bazel" command. It will install bazel dependencies (python27, JDK and MSYS) and then installs bazel. The python27 is not required since we will use Anaconda.
  2. After successful installation, follow the instructions at the end of the installation for configuring the bazel environment variables.
  3. Create a Windows Environment Variable BAZEL_SH=path/to/MSYS/bash(typically it will be C:\tools\msys64\usr\bin\bash.exe).
  4. Add the MSYS bin (e.g. c:\tools\msys64\usr\bin) to the windows PATH at its start (before references to windows shell paths).
  5. Create an environment variable JAVA_HOME=path/to/jdk (e.g. C:\Program Files\Java\jdk1.8.0_121).
  6. bazel will automatically configure BAZEL_VS and BAZEL_PYTHON after it starts.
  7. When bazel is running, it will search for python27.lib (actually the visual studio linker does). It is located under (C:/Anaconda2/libs). I cannot make it visible to VS by any environment variables (neither LIB nor LIBPATH). The only thing worked for me, is copying it under one of the default search paths for visual studio built-in libs e.g. C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64)

Tensorboard Installation

  1. Clone the tensorboard repository.
  2. Modify the installer.sh as follows:
  • Replace "bash configure" with "bash configure --prefix=/mingw"
  • Modify the bazel command to be in the form "bazel build -c opt --cpu=x64_windows_msvc --host_cpu=x64_windows_msvc --copt="/w" --verbose_failures tensorflow/tensorboard:tensorboard"
  1. Open a Windows cmd.exe from the tensorboard repo directory and run "bash installer.sh".
  2. Wait untill the process finished.
  3. Continue as in README .

@ahmedezzat85
Copy link

One more thing. When I run python setup.py, the tensorboard/src directory is not copied to the python package installation directory. It must be manually copied.
The tensorboard binary is nice. no patches are required (maybe the latest tensorflow head fixes windows issues with tensorboard)

@ahmedezzat85
Copy link

I uploaded my changes to this fork --> https://github.com/ahmedezzateasa/tensorboard

@zihaolucky
Copy link
Member Author

@ahmedezzateasa Great! How about creating a PR, I believe this would help Windows users. Besides, you can also change the README.

@ZhaoxiaZhang
Copy link

@ahmedezzateasa I'm a Windows user.My current env is Windows 7 , python 3.6. I followed your step and it seems to install bazel, python 2.7 is installed too. However, when I run window_install.sh, It gave a lot of errors..

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants