CuCalc
CuCalc copied to clipboard
question: installing additional conda packages after build
What is the correct method to install additional conda packages, e.g. sympy, after build is complete and CuCalc is running? If I use conda install sympy
in docker exec -it cucalc bash
then sympy is not available to projects in CuCalc due to issues with file privileges.
The workaround is to create a new local environment in conda for packages you need.
For example, call /opt/conda/bin/conda create -n sympy python=3.6 ipykernel sympy
from terminal in your project to create Python 3.6 environment with sympy installed. Adding ipykernel will allow to use it from Jupyter:
Verify that environment is created: /opt/conda/bin/conda env list
# conda environments:
#
base * /opt/conda
sympy /projects/60381e06-c4b4-4b8b-ae7d-a6dc03b1b13a/.conda/envs/sympy
Add new kernel to Jupyter:
export PATH=/opt/conda/bin${PATH:+:${PATH}}
source activate sympy
(sympy) ~$ python -m ipykernel install --user --name sympy --display-name "Python 3.6 (SymPy)"
Check Jupyter (don't forget to switch kernel)
If you want to have more permanent solution and be able to use it in all of your project, add the following line to a Dockerfile and rebuild the CuCalc image:
RUN /opt/conda/bin/conda create -n sympy python=3.6 sympy