Install Appion Packages Shared » History » Version 15
Anchi Cheng, 07/13/2018 01:21 PM
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 | 11 | Anchi Cheng | That will install each package, and report any failures. To determine the cause of failure, see the generated log file "pysetup.log". |
7 | |||
8 | 13 | Anchi Cheng | {{include(Leginon:packages installed by pysetup.sh)}} |
9 | 12 | Anchi Cheng | |
10 | 11 | Anchi Cheng | h3. alternatively, install a specific package in turn |
11 | |||
12 | 15 | Anchi Cheng | If necessary, you can enter a specific package directory and run the python setup command manually. For example, if pyami failed to install, you can try again like this: |
13 | 1 | Anchi Cheng | |
14 | <pre> |
||
15 | 15 | Anchi Cheng | cd pyami |
16 | 3 | Amber Herold | sudo python setup.py install |
17 | 1 | Anchi Cheng | </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 | 15 | Anchi Cheng | Import a module from the package. Let's try pyami here. All packages installed through the above setup.py script should go to the same place. |
27 | 6 | Amber Herold | At the python prompt (python>) type: |
28 | 15 | Anchi Cheng | <pre>import pyami</pre> |
29 | 1 | Anchi Cheng | |
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 | 15 | Anchi Cheng | pyami.__path__ |
34 | ['/usr/lib/python2.6/site-packages/pyami'] |
||
35 | 1 | Anchi Cheng | </pre> |
36 | |||
37 | 14 | Anchi Cheng | In this case, /usr/lib/python2.6/site-packages/ is your python-site-package-path. If you go to that directory, you will find all the packages you just installed. |
38 | 1 | Anchi Cheng | |
39 | 8 | Anchi Cheng | Save this value as an environment variable for use later, for bash: |
40 | 1 | Anchi Cheng | <pre> |
41 | 14 | Anchi Cheng | export PYTHONSITEPKG='/usr/lib/python2.6/site-packages' |
42 | 1 | Anchi Cheng | </pre> |
43 | or C shell |
||
44 | <pre> |
||
45 | 14 | Anchi Cheng | setenv PYTHONSITEPKG '/usr/lib/python2.6/site-packages' |
46 | 2 | Scott Stagg | </pre> |