How to install additional python packages in the docker pulled dolfinx environment

Hi, fenicsxers. I install dolfinx through docker on windows. Then I configured the remote interpreter on Pycharm.




But my program need additional python packages that the pulled image does not have to run. How can I install other packeges in this environment?

Have you tried using pip to install the package that you want?

I have tried to use ‘pip’, but it seems like it doesn’t install the packages on the docker image of fenicsx. The Pycharm still reminds the packages installed dose not exist.

vscode is probably creating a new container every time you run the code.

Create a new container running the dolfinx image, pip install the packages you need, and then create a new image from the container that contains your additional packages (see eg How to create a new docker image from a running container on Amazon? - Stack Overflow ). Once you have the new image, use that one instead of the plain dolfinx one.

1 Like

Ok, thank you very much! I will try it.