title: Too many pythons on my Mac, and pip install is not install package into the right python package folder
body: <p>I want to use virtualenv on my Mac, and I installed it with pip: </p>
  
  <pre><code>pip install virtualenv
  
  /usr/local/lib/python2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
    cmdoptions.check_install_build_global(options)
  Collecting virtualenv
    Using cached virtualenv-15.1.0.tar.gz
  Skipping bdist_wheel for virtualenv, due to binaries being disabled for it.
  Installing collected packages: virtualenv
    Running setup.py install for virtualenv ... done
  Successfully installed virtualenv
  </code></pre>
  
  <p><strong>Apparently, virtualenv is not installed into the correct Python packages folder. And here is the error:</strong></p>
  
  <pre><code>virtualenv -p python3 --system-site-packages py3
  
  Traceback (most recent call last):
    File "/usr/local/bin/virtualenv", line 6, in &lt;module&gt;
      from pkg_resources import load_entry_point
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3019, in &lt;module&gt;
      @_call_aside
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
      f(*args, **kwargs)
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
      working_set = WorkingSet._build_master()
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 655, in _build_master
      ws.require(__requires__)
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 963, in require
      needed = self.resolve(parse_requirements(requirements))
    File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 849, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'virtualenv==15.1.0' distribution was not found and is required by the application
  </code></pre>
  
  <p>Then I figured I have too many Pythons on my Mac:</p>
  
  <pre><code>sudo find / -type d -name "*site-packages*"
  
  find: /dev/fd/user: No such file or directory
  find: /dev/fd/user: No such file or directory
  /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
  /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
  /Library/Python/2.6/site-packages
  /Library/Python/2.7/site-packages
  /Library/Python/2.7/site-packages/flask/testsuite/test_apps/lib/python2.5/site-packages
  /opt/X11/lib/python2.6/site-packages
  /private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-Nexe_V-uninstall/Library/Python/2.7/site-packages
  /private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-PpXcxM-uninstall/Library/Python/2.7/site-packages
  /private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-ROUjc9-uninstall/Library/Python/2.7/site-packages
  /Users/user/Downloads/virtualenv-15.0.3/py3/lib/python3.6/site-packages
  /Users/user/Library/Enthought/Canopy_64bit/factory-reset-backup/System/lib/python2.7/site-packages
  /Users/user/Library/Enthought/Canopy_64bit/factory-reset-backup/User/lib/python2.7/site-packages
  /Users/user/Library/Enthought/Canopy_64bit/System/lib/python2.7/site-packages
  /Users/user/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages
  /Users/user/Library/Python/2.7/lib/python/site-packages
  /Users/user/Library/Python/3.6/lib/python/site-packages
  /Users/user/py3/lib/python3.6/site-packages
  /Users/user/venv/lib/python2.7/site-packages
  /usr/local/Cellar/numpy/1.11.1/lib/python2.7/site-packages
  /usr/local/Cellar/numpy/1.11.1/libexec/nose/lib/python2.7/site-packages
  /usr/local/Cellar/numpy/1.12.1/lib/python2.7/site-packages
  /usr/local/Cellar/numpy/1.12.1/lib/python3.6/site-packages
  /usr/local/Cellar/numpy/1.12.1/libexec/nose/lib/python2.7/site-packages
  /usr/local/Cellar/numpy/1.12.1/libexec/nose/lib/python3.6/site-packages
  /usr/local/git/lib/python2.7/site-packages
  /usr/local/lib/python2.7/site-packages
  /usr/local/lib/python3.6/site-packages
  </code></pre>
  
  <p>My current python is pointed to <code>/usr/local/bin/python</code>, and my pip is pointed to <code>/usr/local/bin/pip</code>.  And this what's inside of the default pip:</p>
  
  <pre><code>cat /usr/local/bin/pip
  
  #!/usr/local/opt/python/bin/python2.7
  # EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip'
  __requires__ = 'pip==9.0.1'
  import re
  import sys
  from pkg_resources import load_entry_point
  
  if __name__ == '__main__':
      sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
      sys.exit(
          load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
      )
  </code></pre>
  
  <p>And my virtualenv executable is something like this:</p>
  
  <pre><code>cat /usr/local/bin/virtualenv
  
  #!/usr/local/opt/python/bin/python2.7
  # EASY-INSTALL-ENTRY-SCRIPT: 'virtualenv==15.1.0','console_scripts','virtualenv'
  __requires__ = 'virtualenv==15.1.0'
  import re
  import sys
  from pkg_resources import load_entry_point
  
  if __name__ == '__main__':
      sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
      sys.exit(
          load_entry_point('virtualenv==15.1.0', 'console_scripts', 'virtualenv')()
      )
  </code></pre>
  
  <p><strong>How to clean my python installation and point pip and virtualenv installation to the current python package folder?</strong></p>
  
  <p>BTW, without pass pip install-option argument, pip install is not installing packages to the current default python package folder.</p>
  
  <pre><code>pip install --install-option="--install-purelib=/python/packages" virtualenv
  </code></pre>
  
  <p><strong>Even after use pip3, something is still weird with my python:</strong></p>
  
  <pre><code>$ pip3 install virtualenv
  /usr/local/lib/python3.6/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
    cmdoptions.check_install_build_global(options)
  Collecting virtualenv
    Using cached virtualenv-15.1.0.tar.gz
  Skipping bdist_wheel for virtualenv, due to binaries being disabled for it.
  Installing collected packages: virtualenv
    Running setup.py install for virtualenv ... done
  Successfully installed virtualenv
  
  
  
  virtualenv -p python3 --system-site-packages py3
  Traceback (most recent call last):
    File "/usr/local/bin/virtualenv", line 6, in &lt;module&gt;
      from pkg_resources import load_entry_point
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3019, in &lt;module&gt;
      @_call_aside
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
      f(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
      working_set = WorkingSet._build_master()
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 655, in _build_master
      ws.require(__requires__)
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 963, in require
      needed = self.resolve(parse_requirements(requirements))
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 849, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'virtualenv==15.1.0' distribution was not found and is required by the application
  
  
  
  
  pip3 install --install-option="--install-purelib=/python/packages" virtualenv
  /usr/local/lib/python3.6/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
    cmdoptions.check_install_build_global(options)
  Collecting virtualenv
    Using cached virtualenv-15.1.0.tar.gz
  Skipping bdist_wheel for virtualenv, due to binaries being disabled for it.
  Installing collected packages: virtualenv
    Running setup.py install for virtualenv ... error
      Complete output from command /usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-build-mvjkq8ur/virtualenv/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-y9p6_ro7-record/install-record.txt --single-version-externally-managed --compile --install-purelib=/Library/Python/2.7/site-packages --install-purelib=/python/packages:
      running install
      running build
      running build_py
      creating build
      creating build/lib
      copying virtualenv.py -&gt; build/lib
      creating build/lib/virtualenv_support
      copying virtualenv_support/__init__.py -&gt; build/lib/virtualenv_support
      copying virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl -&gt; build/lib/virtualenv_support
      copying virtualenv_support/pip-9.0.1-py2.py3-none-any.whl -&gt; build/lib/virtualenv_support
      copying virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl -&gt; build/lib/virtualenv_support
      copying virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl -&gt; build/lib/virtualenv_support
      running install_lib
      byte-compiling /python/packages/virtualenv.py to virtualenv.cpython-36.pyc
      error: [Errno 13] Permission denied: '/python/packages/__pycache__'
  
      ----------------------------------------
  Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-build-mvjkq8ur/virtualenv/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-y9p6_ro7-record/install-record.txt --single-version-externally-managed --compile --install-purelib=/Library/Python/2.7/site-packages --install-purelib=/python/packages" failed with error code 1 in /private/var/folders/17/y6xv651n50j6gplk57ythm8m0000gn/T/pip-build-mvjkq8ur/virtualenv/
  
  
  
  sudo pip3 install --install-option="--install-purelib=/python/packages" virtualenv
  /usr/local/lib/python3.6/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
    cmdoptions.check_install_build_global(options)
  The directory '/Users/yong/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  The directory '/Users/yong/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Collecting virtualenv
    Downloading virtualenv-15.1.0.tar.gz (1.9MB)
      100% |████████████████████████████████| 1.9MB 824kB/s
  Installing collected packages: virtualenv
    Running setup.py install for virtualenv ... done
  Successfully installed virtualenv
  
  
  
  virtualenv -p python3 --system-site-packages py3
  Traceback (most recent call last):
    File "/usr/local/bin/virtualenv", line 6, in &lt;module&gt;
      from pkg_resources import load_entry_point
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3019, in &lt;module&gt;
      @_call_aside
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
      f(*args, **kwargs)
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3032, in _initialize_master_working_set
      working_set = WorkingSet._build_master()
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 655, in _build_master
      ws.require(__requires__)
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 963, in require
      needed = self.resolve(parse_requirements(requirements))
    File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 849, in resolve
      raise DistributionNotFound(req, requirers)
  pkg_resources.DistributionNotFound: The 'virtualenv==15.1.0' distribution was not found and is required by the application
  
  
  
  ls /usr/local/lib/python3.6/site-packages/
  __pycache__                      pip                              pkg_resources                    setuptools-32.2.0-py3.6.egg-info wheel
  easy_install.py                  pip-9.0.1-py3.6.egg-info         setuptools                       sitecustomize.py                 wheel-0.29.0-py3.6.egg-info
  
  
  
  ls /Library/Python/2.7/site-packages
  Flask_MongoRest-0.1.1-py2.7.egg      colorclass-2.2.0-py2.7.egg-info      idna                                 pyparsing-2.2.0-py2.7.egg-info       terminaltables-3.1.0-py2.7.egg-info
  Flask_Views-0.2.1-py2.7.egg          colorclass-2.2.0-py3.6.egg-info      idna-2.5-py2.7.egg-info              pyparsing-2.2.0-py3.6.egg-info       terminaltables-3.1.0-py3.6.egg-info
  Flask_WTF-0.9.5-py2.7.egg            coverage-3.7.1-py2.7.egg             idna-2.5-py3.6.egg-info              pyparsing.py                         textblob
  IPython                              dateutil                             jinja2                               pyparsing.pyc                        twisted
  Pygments-1.6-py2.7.egg               django                               lxml                                 python_dateutil-2.6.0-py2.7.egg-info urllib3
  WTForms-1.0.5-py2.7.egg              docopt-0.6.2-py2.7.egg-info          mongoengine                          queuelib                             urllib3-1.21.1-py2.7.egg-info
  __pycache__                          docopt-0.6.2-py3.6.egg-info          mysql-0.0.1-py2.7.egg-info           requests                             urllib3-1.21.1-py3.6.egg-info
  awscli-1.9.12-py2.7.egg              docopt.py                            nameparser                           requests-2.17.3-py2.7.egg-info       virtualenv-15.1.0-py2.7.egg-info
  boto                                 docopt.pyc                           nltk                                 requests-2.17.3-py3.6.egg-info       virtualenv-15.1.0-py3.6.egg-info
  bs4                                  docutils                             nose                                 scrapy                               virtualenv.py
  cerberus                             eve                                  nose-1.3.1-py2.7.egg                 simplejson                           virtualenv.pyc
  certifi                              events                               packaging                            six-1.10.0-py2.7.egg-info            virtualenv_support
  certifi-2017.4.17-py2.7.egg-info     flask                                packaging-16.8-py2.7.egg-info        six-1.10.0-py3.6.egg-info            werkzeug
  certifi-2017.4.17-py3.6.egg-info     flask_cuddlyrest                     packaging-16.8-py3.6.egg-info        six.py                               wtforms
  chardet                              flask_mongoengine                    pandas                               six.pyc                              zmq
  chardet-3.0.3-py2.7.egg-info         flask_mongoengine-0.7.0-py2.7.egg    pattern                              sklearn
  chardet-3.0.3-py3.6.egg-info         flask_restful                        pip_upgrader                         sphinx
  cleancat-0.3-py2.7.egg               flask_views                          pip_upgrader-1.4.0-py2.7.egg-info    tablib
  colorclass                           flask_wtf                            pip_upgrader-1.4.0-py3.6.egg-info    terminaltables
  </code></pre>
  
  <p>I had to copy the files to python 3.6 to make it work.</p>
  
  <pre><code>cp -R /Library/Python/2.7/site-packages/virtualenv-15.1.0-py3.6.egg-info /usr/local/lib/python3.6/site-packages/
  cp -R /Library/Python/2.7/site-packages/virtualenv.pyc /usr/local/lib/python3.6/site-packages/
  cp -R /Library/Python/2.7/site-packages/virtualenv.py /usr/local/lib/python3.6/site-packages/
  </code></pre>