title: The gyp==0.1 distribution was not found
body: <p>My project doesn't compile due to a problem with the <code>bson</code> node.js module. I  tried to <code>make</code> it manually and got an error - 'gyp==0.1' not found by a Python script:</p>
  
  <blockquote>
    <p>pkg_resources.DistributionNotFound: The 'gyp==0.1' distribution was
    not found and is required by the application</p>
  </blockquote>
  
  <p>Console:</p>
  
  <pre><code>~/keystone-react/node_modules/bson$ make
  node-gyp clean
  gyp info it worked if it ends with ok
  gyp info using node-gyp@0.12.2
  gyp info using node@0.10.29 | linux | x64
  gyp info ok 
  node-gyp configure build
  gyp info it worked if it ends with ok
  gyp info using node-gyp@0.12.2
  gyp info using node@0.10.29 | linux | x64
  gyp info spawn python
  gyp info spawn args [ '/usr/share/node-gyp/gyp/gyp_main.py',
  gyp info spawn args   'binding.gyp',
  gyp info spawn args   '-f',
  gyp info spawn args   'make',
  gyp info spawn args   '-I',
  gyp info spawn args   '/home/user/keystone-react/node_modules/bson/build/config.gypi',
  gyp info spawn args   '-I',
  gyp info spawn args   '/usr/share/node-gyp/addon.gypi',
  gyp info spawn args   '-I',
  gyp info spawn args   '/usr/include/nodejs/common.gypi',
  gyp info spawn args   '-Dlibrary=shared_library',
  gyp info spawn args   '-Dvisibility=default',
  gyp info spawn args   '-Dnode_root_dir=/usr/include/nodejs',
  gyp info spawn args   '-Dmodule_root_dir=/home/user/keystone-react/node_modules/bson',
  gyp info spawn args   '--depth=.',
  gyp info spawn args   '--generator-output',
  gyp info spawn args   'build',
  gyp info spawn args   '-Goutput_dir=.' ]
  Traceback (most recent call last):
    File "/usr/share/node-gyp/gyp/gyp_main.py", line 9, in &lt;module&gt;
      load_entry_point('gyp==0.1', 'console_scripts', 'gyp')()
    File "/opt/bitnami/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 567, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
    File "/opt/bitnami/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 559, in get_distribution
      dist = get_provider(dist)
    File "/opt/bitnami/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 433, in get_provider
      return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
    File "/opt/bitnami/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 970, in require
      needed = self.resolve(parse_requirements(requirements))
    File "/opt/bitnami/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 856, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'gyp==0.1' distribution was not found and is required by the application
  gyp ERR! configure error 
  gyp ERR! stack Error: `gyp` failed with exit code: 1
  gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
  gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
  gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
  gyp ERR! System Linux 3.16.0-4-amd64
  gyp ERR! command "nodejs" "/usr/bin/node-gyp" "configure" "build"
  gyp ERR! cwd /home/user/keystone-react/node_modules/bson
  gyp ERR! node -v v0.10.29
  gyp ERR! node-gyp -v v0.12.2
  gyp ERR! not ok 
  Makefile:11: recipe for target 'node_gyp' failed
  make: *** [node_gyp] Error 1
  </code></pre>
  
  <p>Original error:</p>
  
  <pre><code>~/keystone-react$ node keystone
  { Error: Cannot find module '../build/Release/bson'
      at Function.Module._resolveFilename (module.js:455:15)
      at Function.Module._load (module.js:403:25)
      at Module.require (module.js:483:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (/home/user/keystone-react/node_modules/bson/ext/index.js:15:10)
      at Module._compile (module.js:556:32)
      at Object.Module._extensions..js (module.js:565:10)
      at Module.load (module.js:473:32)
      at tryModuleLoad (module.js:432:12)
      at Function.Module._load (module.js:424:3)
      at Module.require (module.js:483:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (/home/user/keystone-react/node_modules/bson/lib/bson/index.js:3:24)
      at Module._compile (module.js:556:32)
      at Object.Module._extensions..js (module.js:565:10)
      at Module.load (module.js:473:32) code: 'MODULE_NOT_FOUND' }
  js-bson: Failed to load c++ bson extension, using pure JS version
  
  ------------------------------------------------
  KeystoneJS Started:
  keystone-react is ready on port 3000
  ------------------------------------------------
  </code></pre>