Changes between Initial Version and Version 1 of cypress/PytonInstallPackage

08/23/16 10:23:18 (8 years ago)


  • cypress/PytonInstallPackage

    v1 v1  
     1== Installing Packages ==
     2One of the best things about Python is the number of packages provided by the user community. On a personal machine, the most popular method today for managing these packages is the use of a package manager, like pip. Unfortunately, these require root access and are not a viable solution on Cypress.
     4There is an easy solution. Any well written Python package will allow the user to perform a "user only installation." This typically only requires the addition of a single flag when installing the package.
     6As an example, let's install the package Parallel Python (pp). If you wish to follow along, the package can be downloaded [ here].
     8When you have the packages tar file in the desired directory, you can unpack it with the '''tar''' command
     11[tulaneID@cypress1 ~]$ tar -xvf pp-1.6.4.tar.gz
     38[tulaneID@cypress1 ~]$
     41Now move into the package directory and examine the README file
     44[tulaneID@cypress1 ~]$ cd pp-1.6.4
     45[tulaneID@cypress1 pp-1.6.4]$ ls
     46AUTHORS    COPYING  examples     PKG-INFO
     48[tulaneID@cypress1 pp-1.6.4]$ cat README
     49Visit for up-to-date documentation, examples and support forums
     52    python install
     55    <htmlviewer> pydoc.html
     58After using idev to launch and interactive session,let's try their instructions
     61[tulaneID@cypress01-035 pp-1.6.4]$ python install
     62running install
     63running build
     64running build_py
     65creating build
     66creating build/lib
     67copying -> build/lib
     68copying -> build/lib
     69copying -> build/lib
     70copying -> build/lib
     71copying -> build/lib
     72running build_scripts
     73creating build/scripts-2.7
     74copying and adjusting -> build/scripts-2.7
     75changing mode of build/scripts-2.7/ from 644 to 755
     76running install_lib
     77copying build/lib/ -> /share/apps/anaconda/2.1.0/lib/python2.7/site-packages
     78error: [Errno 13] Permission denied: '/share/apps/anaconda/2.1.0/lib/python2.7/site-packages/'
     79[tulaneID@cypress01-035 pp-1.6.4]$
     82Our installation failed because we lack the permissions to add files to the system wide Python installation. But that's not what we want anyway, we just want to install the package for our personal use. We need to add the flag '''- -prefix=$HOME''' to tell the installer where to place the package.
     85[tulaneID@cypress01-035 pp-1.6.4]$ python install --prefix=$HOME
     86running install
     87running build
     88running build_py
     89running build_scripts
     90running install_lib
     91creating /home/tulaneID/lib
     92creating /home/tulaneID/lib/python2.7
     93creating /home/tulaneID/lib/python2.7/site-packages
     94copying build/lib/ -> /home/tulaneID/lib/python2.7/site-packages
     95copying build/lib/ -> /home/tulaneID/lib/python2.7/site-packages
     96copying build/lib/ -> /home/tulaneID/lib/python2.7/site-packages
     97copying build/lib/ -> /home/tulaneID/lib/python2.7/site-packages
     98copying build/lib/ -> /home/tulaneID/lib/python2.7/site-packages
     99byte-compiling /home/tulaneID/lib/python2.7/site-packages/ to pptransport.pyc
     100byte-compiling /home/tulaneID/lib/python2.7/site-packages/ to pp.pyc
     101byte-compiling /home/tulaneID/lib/python2.7/site-packages/ to ppworker.pyc
     102byte-compiling /home/tulaneID/lib/python2.7/site-packages/ to ppcommon.pyc
     103byte-compiling /home/tulaneID/lib/python2.7/site-packages/ to ppauto.pyc
     104running install_scripts
     105copying build/scripts-2.7/ -> /home/tulaneID/bin
     106changing mode of /home/tulaneID/bin/ to 755
     107running install_egg_info
     108Writing /home/tulaneID/lib/python2.7/site-packages/pp-1.6.4-py2.7.egg-info
     111We now have our own personal build of parallel python.
     114[tulaneID@cypress01-035 pp-1.6.4]$ python
     115Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21)
     116[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
     117Type "help", "copyright", "credits" or "license" for more information.
     118Anaconda is brought to you by Continuum Analytics.
     119Please check out: and
     120>>> import pp
     121>>> pp.version