title: installing a python package from tar.gz
body: <p>I need to use the cvxopt package for python 3. I run Ubuntu.</p>
  
  <p>So I downloaded cvxopt-1.1.9.tar.gz and extracted the content (a single folder called cvxopt-1.1.9) into a folder
  /home/myname/TargetFolder/
  manually, not via the command window.</p>
  
  <ol>
  <li><p>When I run the sequence .configure, then make and then sudo make install, none of them works.</p></li>
  <li><p>There is a setup.py file in /home/myname/TargetFolder/cvxopt-1.1.9/. When I go to that directory in the command window and type python setup.py install, then I get the following error message:</p></li>
  </ol>
  
  <blockquote>
    <p>error: can't create or remove files in install directory</p>
    
    <p>The following error occurred while trying to add or remove files in the
    installation directory:</p>
  </blockquote>
  
  <pre><code>[Errno 13] Permission denied: '/home/myname/anaconda3/lib/python3.5/site-packages/test-easy-install-6110.write-test'
  </code></pre>
  
  <blockquote>
    <p>The installation directory you specified (via --install-dir, --prefix, or
    the distutils default setting) was:</p>
  </blockquote>
  
  <pre><code>/home/myname/anaconda3/lib/python3.5/site-packages/
  </code></pre>
  
  <blockquote>
    <p>Perhaps your account does not have write access to this directory?  If the
    installation directory is a system-owned directory, you may need to sign in
    as the administrator or "root" account.  If you do not have administrative
    access to this machine, you may wish to choose a different installation
    directory, preferably one that is listed in your PYTHONPATH environment
    variable.</p>
    
    <p>For information on other options, you may wish to consult the
    documentation at:</p>
  </blockquote>
  
  <p><a href="https://pythonhosted.org/setuptools/easy_install.html" rel="nofollow noreferrer">https://pythonhosted.org/setuptools/easy_install.html</a></p>
  
  <p>That link doesn't exist anymore.</p>
  
  <ol start="3">
  <li>So I follow the advice on <a href="http://cvxopt.org/install/" rel="nofollow noreferrer">http://cvxopt.org/install/</a> . Apart from the "python setup.py install" command, which didn't work for me, I tried the second thing on their list. Namely "pip install cvxopt"
  This gave:</li>
  </ol>
  
  <blockquote>
    <p>Collecting cvxopt
     Downloading cvxopt-1.1.9.tar.gz (1.9MB)
       100% |████████████████████████████████| 1.9MB 271kB/s 
    Building wheels for collected packages: cvxopt
     Running setup.py bdist_wheel for cvxopt
     Complete output from command /home/myname/anaconda3/bin/python3 -c >"import setuptools;<strong>file</strong>='/tmp/pip-build-r3o_hfm6/cvxopt/setup.py';>exec(compile(open(<strong>file</strong>).read().replace('\r\n', '\n'), <strong>file</strong>, 'exec'))" bdist_wheel -d /tmp/tmpv0ura7txpip-wheel-:</p>
    
    <p>running bdist_wheel
     running a lot of other stuff</p>
  </blockquote>
  
  <p>and then </p>
  
  <blockquote>
    <p>/usr/bin/ld: cannot find -llapack
     /usr/bin/ld: cannot find -lblas
     collect2: error: ld returned 1 exit status
     error: command 'gcc' failed with exit status 1</p>
    
    <hr>
    
    <p>Failed building wheel for cvxopt
    Failed to build cvxopt</p>
  </blockquote>
  
  <p>and then </p>
  
  <blockquote>
    <p>Installing collected packages: cvxopt
      Running setup.py install for cvxopt
        Complete output from command /home/myname/anaconda3/bin/python3 -c "import setuptools, tokenize;<strong>file</strong>='/tmp/pip-build-r3o_hfm6/cvxopt/setup.py';exec(compile(getattr(tokenize, 'open', open)(<strong>file</strong>).read().replace('\r\n', '\n'), <strong>file</strong>, 'exec'))" install --record /tmp/pip-1f4yz1xm-record/install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        UPDATING build/lib.linux-x86_64-3.5/cvxopt/_version.py
        set build/lib.linux-x86_64-3.5/cvxopt/_version.py to '1.1.9'
        running build_ext
        building 'base' extension</p>
  </blockquote>
  
  <p>and then after some more lines it says:</p>
  
  <blockquote>
    <p>/usr/bin/ld: cannot find -llapack
        /usr/bin/ld: cannot find -lblas
        collect2: error: ld returned 1 exit status
        error: command 'gcc' failed with exit status 1</p>
    
    <hr>
    
    <p>Command "/home/myname/anaconda3/bin/python3 -c "import setuptools, tokenize;<strong>file</strong>='/tmp/pip-build-r3o_hfm6/cvxopt/setup.py';exec(compile(getattr(tokenize, 'open', open)(<strong>file</strong>).read().replace('\r\n', '\n'), <strong>file</strong>, 'exec'))" install --record /tmp/pip-1f4yz1xm-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-r3o_hfm6/cvxopt
    You are using pip version 7.1.2, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.</p>
  </blockquote>
  
  <p>If I understood more about Linux and Python I could have focused on the important things and shortened the post a little. But since I know nothing, I post everything I did to maximize the possibility of helpful responses.</p>
  
  <p>Maybe I just don't understand how python works. When I include a package I do this with the </p>
  
  <p><code>import package</code> </p>
  
  <p>command. But <code>import cvxopt</code> doesn't work. So if I understood what it is exactly doing, then maybe I could use logic to give her or him that cvxopt package, where it is looking for it. </p>