Install Appion Packages Shared » History » Version 10
Amber Herold, 04/28/2011 08:59 AM
1 | 1 | Anchi Cheng | <pre> |
---|---|---|---|
2 | 10 | Amber Herold | cd /path/to/myami-VERSION/myami |
3 | 3 | Amber Herold | sudo ./pysetup.sh install |
4 | 1 | Anchi Cheng | </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 | 3 | Amber Herold | sudo python setup.py install |
11 | 1 | Anchi Cheng | </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 | 6 | Amber Herold | At the python prompt (python>) type: |
22 | <pre>import sinedon</pre> |
||
23 | 1 | Anchi Cheng | |
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 | 7 | Amber Herold | sinedon.__path__ |
28 | 1 | Anchi Cheng | ['/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 | 8 | Anchi Cheng | Save this value as an environment variable for use later, for bash: |
34 | 1 | Anchi Cheng | <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 | 2 | Scott Stagg | </pre> |