Install Leginon-only Packages » History » Version 1
Anchi Cheng, 03/04/2011 03:13 PM
1 | 1 | Anchi Cheng | cd /your_download_area |
---|---|---|---|
2 | cd myami |
||
3 | sudo ./pysetup.sh install |
||
4 | </pre> |
||
5 | |||
6 | That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". If necessary, you can enter a specific package directory and run the python setup command manually. For example, if sinedon failed to install, you can try again like this: |
||
7 | |||
8 | <pre> |
||
9 | cd sinedon |
||
10 | sudo python setup.py install |
||
11 | </pre> |
||
12 | |||
13 | h3. python-site-package-path: where the installed python packages went: |
||
14 | |||
15 | Python installer put the packages you installed into its site-packages directory. This enables all users on the same computer to access them. The easiest way to discover where your installed package is loaded from by python is to load a module from the package using interactive python command lines like this: |
||
16 | |||
17 | Start the python command line from shell: |
||
18 | <pre>python</pre> |
||
19 | |||
20 | Import a module from the package. Let's try sinedon here. All packages installed through the above setup.py script should go to the same place. |
||
21 | At the python prompt (python>) type: |
||
22 | <pre>import sinedon</pre> |
||
23 | |||
24 | |||
25 | If the module is loaded successfully, call the module attribute __path__ (two underscrolls before "path" and two underscrolls after) will return the location of the module it is loaded from |
||
26 | <pre> |
||
27 | sinedon.__path__ |
||
28 | ['/usr/lib/python2.4/site-packages/sinedon'] |
||
29 | </pre> |
||
30 | |||
31 | In this case, /usr/lib/python2.4/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed. |
||
32 | |||
33 | Save this value as an environment variable for use later, for bash: |
||
34 | <pre> |
||
35 | export PYTHONSITEPKG='/usr/lib/python2.4/site-packages' |
||
36 | </pre> |
||
37 | or C shell |
||
38 | <pre> |
||
39 | setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages' |
||
40 | </pre> |