70 | | There 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. |
71 | | |
72 | | As an example, let's install the package Parallel Python (pp). If you wish to follow along, the package can be downloaded [http://www.parallelpython.com/content/view/18/32/ here]. |
73 | | |
74 | | When you have the packages tar file in the desired directory, you can unpack it with the '''tar''' command |
75 | | |
76 | | {{{ |
77 | | [tulaneID@cypress1 ~]$ tar -xvf pp-1.6.4.tar.gz |
78 | | pp-1.6.4/ |
79 | | pp-1.6.4/doc/ |
80 | | pp-1.6.4/doc/ppserver.1 |
81 | | pp-1.6.4/doc/example.config |
82 | | pp-1.6.4/doc/ppdoc.html |
83 | | pp-1.6.4/pp.py |
84 | | pp-1.6.4/README |
85 | | pp-1.6.4/pptransport.py |
86 | | pp-1.6.4/PKG-INFO |
87 | | pp-1.6.4/ppcommon.py |
88 | | pp-1.6.4/ppserver.py |
89 | | pp-1.6.4/ppworker.py |
90 | | pp-1.6.4/CHANGELOG |
91 | | pp-1.6.4/MANIFEST.in |
92 | | pp-1.6.4/AUTHORS |
93 | | pp-1.6.4/ppauto.py |
94 | | pp-1.6.4/setup.py |
95 | | pp-1.6.4/examples/ |
96 | | pp-1.6.4/examples/reverse_md5.py |
97 | | pp-1.6.4/examples/sum_primes_functor.py |
98 | | pp-1.6.4/examples/auto_diff.py |
99 | | pp-1.6.4/examples/callback.py |
100 | | pp-1.6.4/examples/quicksort.py |
101 | | pp-1.6.4/examples/dynamic_ncpus.py |
102 | | pp-1.6.4/examples/sum_primes.py |
103 | | pp-1.6.4/COPYING |
104 | | [tulaneID@cypress1 ~]$ |
105 | | }}} |
106 | | |
107 | | Now move into the package directory and examine the README file |
108 | | |
109 | | {{{ |
110 | | [tulaneID@cypress1 ~]$ cd pp-1.6.4 |
111 | | [tulaneID@cypress1 pp-1.6.4]$ ls |
112 | | AUTHORS COPYING examples PKG-INFO ppcommon.py ppserver.py ppworker.py setup.py |
113 | | CHANGELOG doc MANIFEST.in ppauto.py pp.py pptransport.py README |
114 | | [tulaneID@cypress1 pp-1.6.4]$ cat README |
115 | | Visit http://www.parallelpython.com for up-to-date documentation, examples and support forums |
116 | | |
117 | | INSTALATION: |
118 | | python setup.py install |
119 | | |
120 | | LOCAL DOCUMENTATION: |
121 | | <htmlviewer> pydoc.html |
122 | | }}} |
123 | | |
124 | | After using idev to launch and interactive session,let's try their instructions |
125 | | |
126 | | {{{ |
127 | | [tulaneID@cypress01-035 pp-1.6.4]$ python setup.py install |
128 | | running install |
129 | | running build |
130 | | running build_py |
131 | | creating build |
132 | | creating build/lib |
133 | | copying pp.py -> build/lib |
134 | | copying ppauto.py -> build/lib |
135 | | copying ppcommon.py -> build/lib |
136 | | copying pptransport.py -> build/lib |
137 | | copying ppworker.py -> build/lib |
138 | | running build_scripts |
139 | | creating build/scripts-2.7 |
140 | | copying and adjusting ppserver.py -> build/scripts-2.7 |
141 | | changing mode of build/scripts-2.7/ppserver.py from 644 to 755 |
142 | | running install_lib |
143 | | copying build/lib/pptransport.py -> /share/apps/anaconda/2.1.0/lib/python2.7/site-packages |
144 | | error: [Errno 13] Permission denied: '/share/apps/anaconda/2.1.0/lib/python2.7/site-packages/pptransport.py' |
145 | | [tulaneID@cypress01-035 pp-1.6.4]$ |
146 | | }}} |
147 | | |
148 | | Our 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. |
149 | | |
150 | | {{{ |
151 | | [tulaneID@cypress01-035 pp-1.6.4]$ python setup.py install --prefix=$HOME |
152 | | running install |
153 | | running build |
154 | | running build_py |
155 | | running build_scripts |
156 | | running install_lib |
157 | | creating /home/tulaneID/lib |
158 | | creating /home/tulaneID/lib/python2.7 |
159 | | creating /home/tulaneID/lib/python2.7/site-packages |
160 | | copying build/lib/pptransport.py -> /home/tulaneID/lib/python2.7/site-packages |
161 | | copying build/lib/pp.py -> /home/tulaneID/lib/python2.7/site-packages |
162 | | copying build/lib/ppworker.py -> /home/tulaneID/lib/python2.7/site-packages |
163 | | copying build/lib/ppcommon.py -> /home/tulaneID/lib/python2.7/site-packages |
164 | | copying build/lib/ppauto.py -> /home/tulaneID/lib/python2.7/site-packages |
165 | | byte-compiling /home/tulaneID/lib/python2.7/site-packages/pptransport.py to pptransport.pyc |
166 | | byte-compiling /home/tulaneID/lib/python2.7/site-packages/pp.py to pp.pyc |
167 | | byte-compiling /home/tulaneID/lib/python2.7/site-packages/ppworker.py to ppworker.pyc |
168 | | byte-compiling /home/tulaneID/lib/python2.7/site-packages/ppcommon.py to ppcommon.pyc |
169 | | byte-compiling /home/tulaneID/lib/python2.7/site-packages/ppauto.py to ppauto.pyc |
170 | | running install_scripts |
171 | | copying build/scripts-2.7/ppserver.py -> /home/tulaneID/bin |
172 | | changing mode of /home/tulaneID/bin/ppserver.py to 755 |
173 | | running install_egg_info |
174 | | Writing /home/tulaneID/lib/python2.7/site-packages/pp-1.6.4-py2.7.egg-info |
175 | | }}} |
176 | | |
177 | | We now have our own personal build of parallel python. |
178 | | |
179 | | {{{ |
180 | | [tulaneID@cypress01-035 pp-1.6.4]$ python |
181 | | Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21) |
182 | | [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 |
183 | | Type "help", "copyright", "credits" or "license" for more information. |
184 | | Anaconda is brought to you by Continuum Analytics. |
185 | | Please check out: http://continuum.io/thanks and https://binstar.org |
186 | | >>> import pp |
187 | | >>> pp.version |
188 | | '1.6.4' |
189 | | >>> |
190 | | |
191 | | }}} |