title: "<unprintable file name>" error when running pip or venv
body: <p>I have several people on my team that are running into an <strong>intermittent</strong> problem running some very basic Python commands. The following is all in Windows 10, using the Python Launcher (the <code>py</code> command that allows you to setup a default Python – in our case Python 3.7).</p>
  
  <p>Running from a Git repo root directory pip can fail.</p>
  
  <pre class="lang-none prettyprint-override"><code>$ py -m pip install --upgrade pip
  C:\Apps\Python37\python.exe: can't open file '&lt;unprintable file name&gt;': [Errno 2] No such file or directory
  </code></pre>
  
  <p>or setting up a virtual environment.</p>
  
  <pre class="lang-none prettyprint-override"><code>$ py –m venv .venv
  C:\Apps\Python37\python.exe: can't open file '&lt;unprintable file name&gt;': [Errno 2] No such file or directory
  </code></pre>
  
  <p>Clearly it is finding and running Python, but then Python is unable to open some file in the middle of the process. It can't even name the file/directory. I did some searching and the <code>'&lt;unprintable file name&gt;'</code> part may be due to spaces in a folder, but that's the best I've got.</p>
  
  <h3>Notes and things we have tried:</h3>
  
  <ul>
  <li>A few people in the team have never seen this, with the same tools installed (VS Code as IDE, etc.)</li>
  <li>It is a mix of Python 3.7.5 and 3.7.6, I think all 64-bit (Note, I original had 3.7.4 with the same setup and have never seen this)</li>
  <li>Moving Python out of the "C:\Program Files" and the user directory doesn't seem to help</li>
  <li>It is definitely intermittent for all the people that ran into it, sometimes running a few other commands will work, then the bad one suddenly works as well</li>
  <li>We generally use Git Bash as the terminal</li>
  <li>Exactly how <code>Python37</code> and <code>Python37/Scripts</code> shows up in the path varies (whether at beginning/end and User or System path).</li>
  </ul>
  
  <p>I can't find any pattern. We did remove old Python folders from the path, removed all Python paths from the User Path, and moved the current Python 3.7 folders to the top of the system path for one person and it may have fixed the problem.</p>
  
  <h3>Question:</h3>
  
  <p>Any idea what this is? How do you even dig further into this to figure out what is failing?</p>
  
  <h3>Update</h3>
  
  <p>This may only be a problem until pip is updated (either in the system install location and/or in any new virtual environment created). It might be going away after success is intermittently achieved.</p>
  
  <p>I never personally had this issue on my PC with 3.7.4, nor by updating to 3.7.6 in-place as a test, it may be a defect related to version 3.7.5 or 3.7.6 along with the specific version of pip that comes with those packages. However, once pip is successfully updated to 19.3.1, it seems to go away.</p>
  
  <p>My current guesses:</p>
  
  <ul>
  <li>It has something to do with specific versions of Python 3.7 (3.7.5 or 3.7.6) and Pip 19.x interacting with each other poorly, missing a dependency, or something similar.</li>
  <li>It is related to spotty internet or proxy connections to the internet that are causing partial downloads and pip is not detecting the issue (our proxy can take a while to establish the initial connection with some SSO and security stuff going on in the background).</li>
  </ul>