title: Python pip install gives “Command ”python setup.py egg_info“ failed with error code 1”
body: <p>Edit: Yes I know <a href="https://stackoverflow.com/questions/35991403/python-pip-install-gives-command-python-setup-py-egg-info-failed-with-error-c">this question</a> already exists, except my question is a bit different and none of the solutions fixed it.</p>
  
  <p>I do most of my Python stuff when I'm at work and not on my personal machine, but I decided to install it on my personal computer as well. I fresh installed python 3.6.1, and created a virtual environment with <code>virtualenv</code>. Then within the virtualenv I tried to pip install urllib (or any module) and I received the error:</p>
  
  <pre><code>(pdbot) C:\Users\user\Documents\pdbot&gt;pip install urllib
  Collecting urllib
    Using cached urllib-1.21.1.tar.gz
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
        File "&lt;string&gt;", line 1, in &lt;module&gt;
        File "C:\Users\user\AppData\Local\Temp\pip-build-50tn0wlb\urllib\setup.py", line 191
      s.connect((base64.b64decode(rip), 017620))
                                             ^
      SyntaxError: invalid token
  
      ----------------------------------------
  Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-build-50tn0wlb\urllib\
  </code></pre>
  
  <p>I read elsewhere that this error had something to do with setuptools not being properly installed. So I ran this to attempt to fix the issue:</p>
  
  <p><code>easy_install -U setuptools</code></p>
  
  <p>I ended up receiving an even weirder error next:</p>
  
  <pre><code>(pdbot) C:\Users\zeke\Documents\pdbot&gt;easy_install -U setuptools
  Searching for setuptools
  Reading https://pypi.python.org/simple/setuptools/
  Downloading https://pypi.python.org/packages/a9/23/720c7558ba6ad3e0f5ad01e0d6ea2288b486da32f053c73e259f7c392042/setuptools-36.0.1.zip#md5=430eb106788183eefe9f444a300007f0
  Best match: setuptools 36.0.1
  Processing setuptools-36.0.1.zip
  Writing C:\Users\zeke\AppData\Local\Temp\easy_install-jhg1val_\setuptools-36.0.1\setup.cfg
  Running setuptools-36.0.1\setup.py -q bdist_egg --dist-dir C:\Users\zeke\AppData\Local\Temp\easy_install-jhg1val_\setuptools-36.0.1\egg-dist-tmp-8apak7kn
  warning: no files found matching '*' under directory 'setuptools\_vendor'
  Copying setuptools-36.0.1-py3.6.egg to c:\users\zeke\documents\pdbot\lib\site-packages
  Adding setuptools 36.0.1 to easy-install.pth file
  Installing easy_install-script.py script to c:\users\zeke\documents\pdbot\Scripts
  Installing easy_install.exe script to c:\users\zeke\documents\pdbot\Scripts
  error: [WinError 5] Access is denied: 'c:\\users\\zeke\\documents\\pdbot\\Scripts\\easy_install.exe'
  </code></pre>
  
  <p>This looks like a permissions error, but I ran these both in an administrator command prompt (Windows 10) and got the same result. I am the only user on this computer and I have all admin permissions. Is this virtualenv causing an issue? How do I remedy it?</p>
  
  <hr>
  
  <p>EDIT: I was able to fix the permissions issue by leveraging the python executable like so:</p>
  
  <p><code>python -m easy_install -U setuptools</code></p>
  
  <p>But it didn't fix the <code>python setup.py egg_info</code> issue. I still get this error message when trying to <code>pip install</code> anything:</p>
  
  <pre><code>Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-build-50tn0wlb\urllib\
  </code></pre>
  
  <p>I have tried both <code>python -m pip install urllib</code> and <code>pip install urllib</code> and neither work.</p>