title: no module named 'Pil' while using tensorflow
body: <p>I am totally new to Machine learning. I was using <a href="https://www.tensorflow.org/" rel="nofollow noreferrer">Tensorflow</a> for machine learning. While, i was following <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets-2/#4" rel="nofollow noreferrer">code lab</a> for this. And i was compressing my model and testing it using following script </p>
  
  <pre><code>python -m scripts.evaluate  tf_files/optimized_graph.pb
  </code></pre>
  
  <p>i got this exception <code>no module name 'Pil'</code>
  below is screenshot.</p>
  
  <p><a href="https://i.stack.imgur.com/voLTO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/voLTO.png" alt="enter image description here"></a></p>
  
  <p>when i tried installing pip using this command <code>pip install Pillow</code>. I got this exception. </p>
  
  <p>Exception:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\ba
  and.py", line 215, in main
      status = self.run(options, args)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\co
  \install.py", line 335, in run
      wb.build(autobuilding=True)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\wh
  ", line 749, in build
      self.requirement_set.prepare_files(self.finder)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\re
  set.py", line 380, in prepare_files
      ignore_dependencies=self.ignore_dependencies))
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\re
  set.py", line 554, in _prepare_file
      require_hashes
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\re
  install.py", line 278, in populate_link
      self.link = finder.find_requirement(self, upgrade)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 465, in find_requirement
      all_candidates = self.find_all_candidates(req.name)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 423, in find_all_candidates
      for page in self._get_pages(url_locations, project_name):
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 568, in _get_pages
      page = self._get_page(location)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 683, in _get_page
      return HTMLPage.get_page(link, session=self.session)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 811, in get_page
      inst = cls(resp.content, resp.url, resp.headers)
    File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\pip\in
  ", line 731, in __init__
      namespaceHTMLElements=False,
  TypeError: parse() got an unexpected keyword argument 'transport_encoding'
  </code></pre>
  
  <p>I am new to this and don't know whats going wrong</p>
  
  <p><em>UPDATED</em></p>
  
  <p>as suggested from Bodhi94 in answer bellow i replaced my html5 with the git file given in link and successfully installed <code>pip install Pillow</code> but when i run <code>python -m scripts.evaluate  tf_files/optimized_graph.pb</code> command again it gave me this exception.</p>
  
  <pre><code>  File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\runpy.py", line 193, 
  in _run_module_as_main
  "__main__", mod_spec)
   File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\runpy.py", line 85, in 
  _run_code   exec(code, run_globals)
   File "D:\tensorflow\tensorflow-for-poets-2\scripts\evaluate.py", line 91, in &lt;module&gt;
  accuracy,xent = evaluate_graph(*sys.argv[1:])
   File "D:\tensorflow\tensorflow-for-poets-2\scripts\evaluate.py", line 37, in evaluate_graph
   image_buffer_input = graph.get_tensor_by_name('input:0')
   File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\tensorflow\python\framework\ops.py", line 2880, in get_tensor_by_name
   return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
  
   File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\tensorflow\python\framework\ops.py", line 2708, in as_graph_element
  return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  File "C:\ProgramData\Anaconda3\envs\tensorflow2\lib\site-packages\tensorflow\python\framework\ops.py", line 2750, in _as_graph_element_locked
  "graph." % (repr(name), repr(op_name)))
  KeyError: "The name 'input:0' refers to a Tensor which does not exist. The operation, 'input', does not exist in the graph."
  </code></pre>