Install Appion Packages Shared » History » Version 9
Anchi Cheng, 03/04/2011 03:09 PM
1 | 1 | Anchi Cheng | <pre> |
---|---|---|---|
2 | cd /your_download_area |
||
3 | cd myami |
||
4 | 3 | Amber Herold | sudo ./pysetup.sh install |
5 | 1 | Anchi Cheng | </pre> |
6 | |||
7 | 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: |
||
8 | |||
9 | <pre> |
||
10 | cd sinedon |
||
11 | 3 | Amber Herold | sudo python setup.py install |
12 | 1 | Anchi Cheng | </pre> |
13 | |||
14 | h3. python-site-package-path: where the installed python packages went: |
||
15 | |||
16 | 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: |
||
17 | |||
18 | Start the python command line from shell: |
||
19 | <pre>python</pre> |
||
20 | |||
21 | 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. |
||
22 | 6 | Amber Herold | At the python prompt (python>) type: |
23 | <pre>import sinedon</pre> |
||
24 | 1 | Anchi Cheng | |
25 | |||
26 | 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 |
||
27 | <pre> |
||
28 | 7 | Amber Herold | sinedon.__path__ |
29 | 1 | Anchi Cheng | ['/usr/lib/python2.4/site-packages/sinedon'] |
30 | </pre> |
||
31 | |||
32 | 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. |
||
33 | |||
34 | 8 | Anchi Cheng | Save this value as an environment variable for use later, for bash: |
35 | 1 | Anchi Cheng | <pre> |
36 | export PYTHONSITEPKG='/usr/lib/python2.4/site-packages' |
||
37 | </pre> |
||
38 | or C shell |
||
39 | <pre> |
||
40 | setenv PYTHONSITEPKG '/usr/lib/python2.4/site-packages' |
||
41 | 2 | Scott Stagg | </pre> |