| | 1 | ==== Install Packages to Anaconda Python ==== |
| | 2 | |
| | 3 | 'conda' is the command to add packages to Anaconda python distribution. However, since you don't have a permission in /share/apps/anaconda, it won't work. |
| | 4 | There is a workaround. Here, for example, we want to add 'vtk' python wrapper library. |
| | 5 | |
| | 6 | {{{ |
| | 7 | conda install vtk |
| | 8 | }}} |
| | 9 | |
| | 10 | But you will see an error message with an instruction for the workaround. Following the instruction, you have to clone the python environment into your home directory by |
| | 11 | |
| | 12 | {{{ |
| | 13 | conda create -n my_root --clone=/share/apps/anaconda/2/2.5.0 |
| | 14 | }}} |
| | 15 | |
| | 16 | 'my_root' is the name of environment that you decide. |
| | 17 | Then, |
| | 18 | |
| | 19 | {{{ |
| | 20 | source activate my_root |
| | 21 | }}} |
| | 22 | |
| | 23 | Finally, you can install the package, |
| | 24 | |
| | 25 | {{{ |
| | 26 | conda install vtk |
| | 27 | }}} |
| | 28 | |
| | 29 | In case you encounter "Error: 'conda' can only be installed into the root environment", try |
| | 30 | |
| | 31 | {{{ |
| | 32 | conda remove conda-build |
| | 33 | conda remoce conda-env |
| | 34 | conda update -all |
| | 35 | conda install vtk |
| | 36 | }}} |
| | 37 | |
| | 38 | From next time, to use Anaconda python with your environment, |
| | 39 | {{{ |
| | 40 | module load anaconda |
| | 41 | source activate my_root |
| | 42 | }}} |
| | 43 | You have to state above commands in your script when you run python on batch jobs. |
| | 44 | |