title: How to install and run virtualenv on MacOS correctly
body: <p>Hi I'm a beginner of python, I don't remember when and how I installed python3.8 on my Macbook air, only knew the installed path:</p>
  <pre><code>% which python
  /usr/bin/python
  % which python3
  /usr/local/bin/python3
  </code></pre>
  <p>The pip command cannot not be found but pip3 is ok. Today I want to install virtaulenv:</p>
  <pre><code>% sudo -H pip3 install virtualenv
  WARNING: Ignoring invalid distribution - (/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages)
  Successfully installed virtualenv-20.6.0
  </code></pre>
  <p>I can use &quot;pip3 show virtualenv&quot; to know the info:</p>
  <pre><code>% pip3 show virtualenv
  Name: virtualenv
  Version: 20.6.0
  Summary: Virtual Python Environment builder
  Home-page: https://virtualenv.pypa.io/
  Author: Bernat Gabor
  Author-email: gaborjbernat@gmail.com
  License: MIT
  Location: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
  Requires: six, platformdirs, backports.entry-points-selectable, distlib, filelock
  Required-by:
  </code></pre>
  <p>But when I use &quot;virtualenv&quot; I got command not found message then I &quot;pip3 uninstall&quot; it. I searched for this and got a tip to use &quot;easy_install&quot; to install virtualenv. After installed I can execute the command, but got some error message:</p>
  <pre><code>% virtualenv                     
  Traceback (most recent call last):
    File &quot;/usr/local/bin/virtualenv&quot;, line 6, in &lt;module&gt;
      from pkg_resources import load_entry_point
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 3241, in &lt;module&gt;
      @_call_aside
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 3225, in _call_aside
      f(*args, **kwargs)
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 3254, in _initialize_master_working_set
      working_set = WorkingSet._build_master()
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 583, in _build_master
      ws.require(__requires__)
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 900, in require
      needed = self.resolve(parse_requirements(requirements))
    File &quot;/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py&quot;, line 786, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'importlib-resources&gt;=1.0' distribution was not found and is required by virtualenv
  </code></pre>
  <p>It seems doesn't work and I try the &quot;sudo pip3 uninstall virtualenv&quot; to uninstall it successfully, but it seems not really be removed:</p>
  <pre><code>% which virtualenv              
  /usr/local/bin/virtualenv
  </code></pre>
  <p>I have no idea about this, could you help me? I just want to run virtualenv normally and create flask project ...</p>
  <p>PS. I can &quot;sudo pip3 install flask&quot; and &quot;pip3 show flask&quot; but still cannot run flask cammand (command not found), what should I do?</p>
  <p>Thanks a lot!</p>