I’m using dolfinx with docker on M1 Mac book pro and have a problem using pyvista.
When I type pip list, pyvista is not listed and so I tried to install pyvista, but got following error message.
ERROR: Cannot install pyvista==0.20.0, pyvista==[long list of versions]
because these package versions have conflicting dependencies.
The conflict is caused by:
pyvista 0.35.2 depends on vtk
pyvista [other versions] depends on vtk
Therefore, I tried to install vtk but that also did not work with the following error message.
root@c19dbdc6113d:/# pip install vtk
ERROR: Could not find a version that satisfies the requirement vtk (from versions: none)
ERROR: No matching distribution found for vtk
I tried the solution suggested in the link, but that also did not work.
As I am not familiar with docker, I might have done something wrong when setting up docker container.
Could you first of all clarify what docker image you are using? If you are using the dolfinx/dolfinx image, could you print dolfinx.common.git_commit_hash, and check if you can find vtk in dolfinx/lab?
I’m, using dolfinx/dolfinx and the output of dolfinx.common.git_commit_hash is 1b27281ac329f1cd1fd7cb3e2d66096e53ad47c3. I do not use dolfinx/lab but I can try and see if vtk is available with it. Thanks for your help.
[EDIT] I tried to use dolfinx/lab with docker run -ti dolfinx/lab:latest but the link shown after
To access the server, open this file in a browser:
Or copy and paste one of these URLs:
did not work for me. My browser (safari and chrome) could not open the link somehow.
This could be Mac specific, as I am using an image built off of dolfinx/dolfinxhere for some testing (the commit hash is the same as yours). I believe pyvista comes with dolfinx/dolfinx
Have you tried copy-pasting the links in chrome as-is instead of clicking them? The latter usually works for me consistently across all machines (linux/windows though), of course with the corresponding token (which is in the link).
Thank you for your answer! Yes, I checked docker file and believe dolfinx/dolfinx should come with pyvista…
I copy-pasted the link in chrome but it did not work. Also I’m building some python package with dolfinx, so working on jupyter notebook is not really optimal for me
dolfinx/dolfinx does not come with pyvista. It is only added in the dolfinx/lab environment.
You can run the dolfinx/lab image as a normal image by overriding the entrypoint:
ocker run -ti --rm -v $(pwd):/root/shared --entrypoint="/bin/bash" dolfinx/lab
Yes, it should be the latest image.
My output looks like
$ docker pull dolfinx/lab
Using default tag: latest
latest: Pulling from dolfinx/lab
Digest: sha256:1bba92776bbb301bf47868c8bffecc87b967bad3b9d982096a081cfcce612728
Status: Image is up to date for dolfinx/lab:latest
docker.io/dolfinx/lab:latest
$ docker run -ti --rm -v $(pwd):/root/shared --entrypoint="/bin/bash" dolfinx/lab
root@fe0106d317fa:~#
root@fe0106d317fa:~# python3 -c "import dolfinx; print(dolfinx.common.git_commit_hash); import pyvista; print(pyvista.__version__)"
1b27281ac329f1cd1fd7cb3e2d66096e53ad47c3
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pyvista'
So the git_commit.hash is the same as yours but pyvista is still not available to me.
Unfortunately there are no binary wheels of VTK for Linux arm64 so we cannot straightforwardly include pyvista, which depends on VTK, in our arm64 docker image.
It seems like it is technically possible to build VTK arm64 wheels so we can hope that these become available in the future and then we can enable pyvista in our arm64 images.
I managed to solve this problem by compiling vtk from source on my MacBook Pro (M1 Pro) and directly referring to the wheel with pip after launching the container.
I am quite new to FEniCS, and after finally managing to get my docker install working I have just his this same problem. Has there been any development on a solution/work around?