Install Leginon-only Packages » History » Version 2
Anchi Cheng, 05/31/2013 01:52 PM
| 1 | 2 | Anchi Cheng | h2. Install with pysetup.sh |
|---|---|---|---|
| 2 | |||
| 3 | 1 | Anchi Cheng | cd /your_download_area |
| 4 | cd myami |
||
| 5 | sudo ./pysetup.sh install |
||
| 6 | </pre> |
||
| 7 | |||
| 8 | 2 | Anchi Cheng | That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". |
| 9 | |||
| 10 | h2. install individual package |
||
| 11 | |||
| 12 | If pysetup.sh does not work, 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: |
||
| 13 | 1 | Anchi Cheng | |
| 14 | <pre> |
||
| 15 | cd sinedon |
||
| 16 | sudo python setup.py install |
||
| 17 | </pre> |
||
| 18 | |||
| 19 | h3. python-site-package-path: where the installed python packages went: |
||
| 20 | |||
| 21 | 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: |
||
| 22 | |||
| 23 | Start the python command line from shell: |
||
| 24 | <pre>python</pre> |
||
| 25 | |||
| 26 | 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. |
||
| 27 | At the python prompt (python>) type: |
||
| 28 | <pre>import sinedon</pre> |
||
| 29 | |||
| 30 | |||
| 31 | 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 |
||
| 32 | <pre> |
||
| 33 | sinedon.__path__ |
||
| 34 | ['/usr/lib/python2.4/site-packages/sinedon'] |
||
| 35 | </pre> |
||
| 36 | |||
| 37 | 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. |
||
| 38 | |||
| 39 | Save this value as an environment variable for use later, for bash: |
||
| 40 | <pre> |
||
| 41 | export PYTHONSITEPKG='/usr/lib/python2.4/site-packages' |
||
| 42 | </pre> |
||
| 43 | or C shell |
||
| 44 | <pre> |
||
| 45 | setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages' |
||
| 46 | </pre> |