title: lxml will never finish building on ubuntu
body: <p>I am running ubuntu 14.04 LTS and python 2.7.5 on a vwmare. </p>
  
  <p>When I run:</p>
  
  <pre><code>sudo pip install lxml
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Collecting lxml
    Using cached lxml-3.4.4.tar.gz
  Building wheels for collected packages: lxml
    Running setup.py bdist_wheel for lxml
  </code></pre>
  
  <p>which runs eternally.</p>
  
  <p>I can't find any resources related to this, nor do I have any experience with similar errors.</p>
  
  <p>Note, the solution below does not work:</p>
  
  <pre><code>sudo apt-get build-dep -y lxml;
  pip install lxml
  </code></pre>
  
  <p>I have also tried:</p>
  
  <pre><code>sudo apt-get install -y build-essential python-dev
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  build-essential is already the newest version.
  python-dev is already the newest version.
  The following packages were automatically installed and are no longer required:
    linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
    linux-headers-3.13.0-57 linux-headers-3.13.0-57-generic
    linux-image-3.13.0-32-generic linux-image-3.13.0-57-generic
    linux-image-extra-3.13.0-32-generic linux-image-extra-3.13.0-57-generic
  Use 'apt-get autoremove' to remove them.
  0 upgraded, 0 newly installed, 0 to remove and 75 not upgraded.
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I just ran it again and got:</p>
  
  <pre><code>sudo pip install lxml
  
  Collecting lxml
  /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Using cached lxml-3.4.4.tar.gz
  Building wheels for collected packages: lxml
    Running setup.py bdist_wheel for lxml
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <pre><code> pip install lxml
  
  The directory '/home/myusername/.cache/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 '/home/myusername/.cache/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 lxml
  /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Downloading lxml-3.4.4.tar.gz (3.5MB)
      100% |████████████████████████████████| 3.5MB 7.0kB/s 
  Installing collected packages: lxml
    Running setup.py install for lxml
  </code></pre>
  
  <p>EDIT 3:
  After waiting a long time the command gave:</p>
  
  <pre><code>pip install lxml
  The directory '/home/mstaffel/.cache/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 '/home/mstaffel/.cache/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 lxml
  /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
    InsecurePlatformWarning
    Downloading lxml-3.4.4.tar.gz (3.5MB)
      100% |████████████████████████████████| 3.5MB 7.0kB/s 
  Installing collected packages: lxml
    Running setup.py install for lxml
      Complete output from command /usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-u3iJ67/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0tAWPp-record/install-record.txt --single-version-externally-managed --compile:
      /usr/local/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
        warnings.warn(msg)
      Building lxml version 3.4.4.
      Building without Cython.
      Using build configuration of libxslt 1.1.28
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-i686-2.7
      creating build/lib.linux-i686-2.7/lxml
      copying src/lxml/pyclasslookup.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/cssselect.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/__init__.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/_elementpath.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/doctestcompare.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/builder.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/ElementInclude.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/usedoctest.py -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/sax.py -&gt; build/lib.linux-i686-2.7/lxml
      creating build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/__init__.py -&gt; build/lib.linux-i686-2.7/lxml/includes
      creating build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/__init__.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/_diffcommand.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/soupparser.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/builder.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/usedoctest.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/html5parser.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/_setmixin.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/_html5builder.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/defs.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/clean.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/ElementSoup.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/diff.py -&gt; build/lib.linux-i686-2.7/lxml/html
      copying src/lxml/html/formfill.py -&gt; build/lib.linux-i686-2.7/lxml/html
      creating build/lib.linux-i686-2.7/lxml/isoschematron
      copying src/lxml/isoschematron/__init__.py -&gt; build/lib.linux-i686-2.7/lxml/isoschematron
      copying src/lxml/lxml.etree.h -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/lxml.etree_api.h -&gt; build/lib.linux-i686-2.7/lxml
      copying src/lxml/includes/htmlparser.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/tree.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/schematron.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xmlparser.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xinclude.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/c14n.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xpath.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xslt.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xmlschema.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/xmlerror.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/uri.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/relaxng.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/etreepublic.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/config.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/dtdvalid.pxd -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/etree_defs.h -&gt; build/lib.linux-i686-2.7/lxml/includes
      copying src/lxml/includes/lxml-version.h -&gt; build/lib.linux-i686-2.7/lxml/includes
      creating build/lib.linux-i686-2.7/lxml/isoschematron/resources
      creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/rng
      copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/rng
      creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
      copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl
      creating build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -&gt; build/lib.linux-i686-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
      running build_ext
      building 'lxml.etree' extension
      creating build/temp.linux-i686-2.7
      creating build/temp.linux-i686-2.7/src
      creating build/temp.linux-i686-2.7/src/lxml
      gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-u3iJ67/lxml/src/lxml/includes -I/usr/local/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -w
      gcc -pthread -shared build/temp.linux-i686-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-i686-2.7/lxml/etree.so
      building 'lxml.objectify' extension
      gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip-build-u3iJ67/lxml/src/lxml/includes -I/usr/local/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.linux-i686-2.7/src/lxml/lxml.objectify.o -w
      gcc -pthread -shared build/temp.linux-i686-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-i686-2.7/lxml/objectify.so
      running install_lib
      creating /usr/local/lib/python2.7/site-packages/lxml
      error: could not create '/usr/local/lib/python2.7/site-packages/lxml': Permission denied
  
      ----------------------------------------
  Command "/usr/local/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-u3iJ67/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-0tAWPp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-u3iJ67/lxml
  </code></pre>