Repository: conda/conda-build

Issue:
FileNotFoundError: [WinError 2] The system cannot find the file specified
I have an error when I'm trying to build a meta recipe in Windows.

```
BUILD START: anaconda-notebook-2.4-py34_0
Removing old work directory
Copying C:\Users\builder\Documents\GitHub\anaconda-notebook to C:\Users\builder\Miniconda3\conda-bld\work
There was an error importing jinja2.
Please run `conda install jinja2` to enable jinja template support
Package: anaconda-notebook-2.4-py34_0
source tree in: C:\Users\builder\Miniconda3\conda-bld\work
An unexpected error has occurred, please consider sending the
following traceback to the conda GitHub issue tracker at:

    https://github.com/conda/conda-build/issues

Include the output of the command 'conda info' in your report.


Traceback (most recent call last):
  File "C:\Users\builder\Miniconda3\Scripts\conda-build-script.py", line 4, in <module>
    sys.exit(main())
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 110, in main
    args_func(args, p)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 312, in args_func
    args.func(args, p)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\main_build.py", line 272, in execute
    build.build(m, verbose=not args.quiet, post=post)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\build.py", line 365, in build
    windows.build(m)
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\windows.py", line 95, in build
    env.update(environ.get_dict(m))
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\environ.py", line 94, in get_dict
    d.update(**get_git_build_info(d['SRC_DIR']))
  File "C:\Users\builder\Miniconda3\lib\site-packages\conda_build\environ.py", line 47, in get_git_build_info
    env=env)
  File "C:\Users\builder\Miniconda3\lib\subprocess.py", line 858, in __init__
    restore_signals, start_new_session)
  File "C:\Users\builder\Miniconda3\lib\subprocess.py", line 1111, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
```

```
PS C:\Users\builder\Documents\GitHub\anaconda-notebook> conda info
Current conda install:

             platform : win-64
        conda version : 3.9.0
  conda-build version : 1.10.2
       python version : 3.4.2.final.0
     requests version : 2.5.1
     root environment : C:\Users\builder\Miniconda3  (writable)
  default environment : C:\Users\builder\Miniconda3
     envs directories : C:\Users\builder\Miniconda3\envs
        package cache : C:\Users\builder\Miniconda3\pkgs
         channel URLs : https://conda.binstar.org/javascript/win-64/
                        https://conda.binstar.org/javascript/noarch/
                        http://repo.continuum.io/pkgs/free/win-64/
                        http://repo.continuum.io/pkgs/free/noarch/
                        http://repo.continuum.io/pkgs/pro/win-64/
                        http://repo.continuum.io/pkgs/pro/noarch/
          config file : C:\Users\builder\.condarc
    is foreign system : False
```



Discussion:

Resolving patch:
diff --git a/conda_build/main_pipbuild.py b/conda_build/main_pipbuild.py
--- a/conda_build/main_pipbuild.py
+++ b/conda_build/main_pipbuild.py
@@ -7,6 +7,7 @@
 from __future__ import print_function, division, absolute_import
 
 import sys
+import os
 import os.path
 import subprocess
 import yaml
@@ -204,12 +205,19 @@ def get_all_dependencies(package, version):
     cmd1 = "conda create -n _pipbuild_ --yes python pip"
     print(cmd1)
     subprocess.Popen(cmd1.split()).wait()
+
     cmd2 = "%s/bin/pip install %s==%s" % (prefix, package, version)
+    cmd3args = ['%s/bin/python' % prefix, '__tmpfile__.py']
+
+    if sys.platform == "win32":
+        cmd2 = "{} install {}=={}".format(
+            os.path.join(prefix, "Scripts", "pip"), package, version)
+        cmd3args = [os.path.join(prefix, "python"), '__tmpfile__.py']
+
     print(cmd2)
     ret = subprocess.Popen(cmd2.split()).wait()
     if ret != 0:
         raise RuntimeError("Could not pip install %s==%s" % (package, version))
-    cmd3args = ['%s/bin/python' % prefix, '__tmpfile__.py']
     fid = open('__tmpfile__.py', 'w')
     fid.write("import pkg_resources;\n")
     fid.write("reqs = pkg_resources.get_distribution('%s').requires();\n" %


Test patch: