I am using a Windows installation of Dolfinx (FeNICSx) using docker containers. I created a container using the following code:
docker run --init -p 8888:8888 -v %cd%:/root/shared --name=dolfinx_test0 dolfinx/lab:latest
I created a jupyter notebook under this container. When I run the code from dolfinx import default_scalar_type, I am getting the following error:
ImportError Traceback (most recent call last)
Cell In [4], line 6
3 from dolfinx.fem import (Constant, Function, FunctionSpace, assemble_scalar, form, locate_dofs_topological)
4 from dolfinx.fem.petsc import (LinearProblem, assemble_vector, assemble_matrix, create_vector,
5 apply_lifting, set_bc)
----> 6 from dolfinx import default_scalar_type
7 from dolfinx.io import XDMFFile
8 from dolfinx.mesh import create_rectangle, locate_entities, locate_entities_boundary, meshtags, CellType
ImportError: cannot import name ‘default_scalar_type’ from ‘dolfinx’ (/usr/local/dolfinx-real/lib/python3.10/dist-packages/dolfinx/init.py)
Rest of the lines in the above code are running without a problem. I am getting the same error when I run from dolfinx.plot import vtk_mesh. I am running the below dolfinx version
The latest tag is no longer updated, please use any of dolfinx/lab:nighlty, dolfinx/lab:stable, dolfinx/lab:v0.7.0 to get dolfinx.default_scalar_type, as it was introduced in between v0.6.0 and v0.7.0.
hi, can you pls elaborate what do you mean by your solution? how so i implement that? what do i use instead of “from dolfinx import log, default_scalar_type”