Installation problems

Regarding pip: Don’t you have to run this command every time you start the docker container? Genuine question, I didn’t think it would save your changes to the container
The --user-flag tell pip to install your package into your own home directory, where you have access to. Without, your pip tries to install the package globally (for all users) into a directory where you don’t have access to, but only a superuser/root/admin/…

Regarding the ports: I’m not quite sure, but I think using the -p-flag makes it possible to just call localhost:8888, instead of host.docker....
You can do various things with this, e.g. starting a jupyter notebook and accessing it via your browser, or, what I like to do, to start an IPython kernel and then connect Spyder to it.

Regarding pip: I did exit the last docker and startet a new one with docker run -ti -v C:/Users/neuma/fenics/testdir:/home/fenics quay.io/fenicsproject/stable:latest like before. This time everything was working fine (no problems importing fenics, fenics_adjoint, etc.) and I did not have to pip install anything again.

Regarding the ports: Nice, so is it possible to use the PyCharm IDE from within the docker as well? Would be great to gain some basic functionalities like debugging and code analyzing instead of just running scripts from the power shell.

So by starting the docker with docker run -ti -v C:/Users/neuma/fenics/testdir:/home/fenics quay.io/fenicsproject/stable:latest I assume that I can see results like a plot when calling localhost:8888 in any browser. Running this plot_test.py:

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(1,10,10)

plt.figure()
plt.plot(x,x)
plt.show()

does go through in the power shell, but when I call it I get

This page does not work
localhost has not sent any data.
ERR_EMPTY_RESPONSE

No it, doesn’t. IIRC, the only thing that the -p flag does is that if you run a server in your container (whatever kind of server you want), which listens to port 8888, then you can call the server inside the container also from outside via localhost through port 8888. It is your own responsibility to start the server you want.

There are different things you can do, which includes Jupyter notebooks or IPython kernels. I highly recommend to read about them on their project pages and choose whatever solution works for you the best. For starters, you can read here how IPython works (not the best tutorial, but a start :wink: )
Further, other users here have shared some links regarding Jupyter with fenics, I think.

To be honest, this hasn’t much to do with fenics anymore, but more with IPython and docker, and one of the respective forums would probably be a better place for your questions.

All right, I’ll see how far I can get on this one. And yes you’re right. We are drifting away from fenics here.

Many thanks for the extensive help!