title: pyinstaller No module named grpc
body: <p>My goal is to build an executable using pyinstaller. The python script I am trying to build imports grpc. The following is an example that illustrates the problem called hello.py.</p>
  
  <pre><code>  import grpc
    if __name__ == '__main__':
       print "hello world"
  </code></pre>
  
  <p>I do <code>pyinstaller hello.py</code> and that produces the expected dist directory. Then I run it like <code>./dist/hello/hello</code> and I get error <code>ImportError: No module named grpc.</code> </p>
  
  <p>So then I installed grpc using <code>pip install grpc</code>. When I rebuild the artifact I now get error <code>Import grpc:No module named gevent.socket</code>. </p>
  
  <p>Reading online indicated that the correct items to install were actually grpcio and grpcio-tools. So I tried <code>pip uninstall grpc</code> <code>pip install grpcio</code> and <code>pip install grpcio-tools</code>. Doing this and rebuilding the artifact gave me error <code>ImportError: No module named pkg_resources</code>. Trying to <code>pip install pkg_resources</code> gives error: <code>Could not find a version that satisfies the requirement pkg_resources</code></p>
  
  <p>Having all <code>grpcio</code> <code>grpcio-tools</code> and <code>grpc</code> install gives the same error: <code>Import grpc:No module named gevent.socket</code></p>
  
  <p>This seems like it should be a very simple task. I simply want to use pyinstaller to build an artifact that has a dependency on grpc, how do I do this?</p>