Basix dependancy missing

Hi,

I am trying to install fenicsx using pip and it seems to be working, except that I get the following error when running code:

Traceback (most recent call last):

File ~/.local/lib/python3.10/site-packages/spyder_kernels/customize/utils.py:209 in exec_encapsulate_locals
exec_fun(compile(code_ast, filename, “exec”), globals)

File ~/robotDepowdering/fenics_example.py:16
from dolfinx import mesh, fem, plot, io, default_scalar_type

File /usr/lib/petsc/lib/python3/dist-packages/dolfinx/init.py:34
pusimp.prevent_user_site_imports(

File /usr/lib/python3/dist-packages/pusimp/prevent_user_site_imports.py:187 in prevent_user_site_imports
raise ImportError(import_error)

ImportError: pusimp has detected the following problems with dolfinx dependencies:

  1. Missing dependencies:
  • basix is missing. Its expected path was /usr/lib/python3/dist-packages/basix/init.py.

pusimp suggests to apply all of the following fixes:

  1. To install missing dependencies:
  • check how to install basix with apt.

I tried using apt to install basix and it still doens’t work. Is there anything else I could try?

Thank you,
Alex

apt install python3-basix

?

You definitely have a broken system configuration, because apt will never have installed dolfinx without basix.

This is a large part of the problem. In general, you never want to use pip to install complex packages (packages involving compiled binary libraries). The pusimp error explains the problem.

Edit: /usr/lib/petsc/lib/python3/dist-packages/dolfinx/__init__.py is correct (I missed petsc in the middle in my first reading).

You can find FEniCS installation instructions at https://fenicsproject.org/download/

Hi, thank you for the prompt reply: I tried this and it didn’t change the error message. After typing this I get the following:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
python3-basix is already the newest version (0.8.0-3~ppa1~jammy2).
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.

Check apt-installed versions with

dpkg -l "*fenics*" "*dolfinx*" "*ffcx*" "*basix*" "*ufl*" "libpetsc*dev"

Check also that there are none of these packages installed by pip in ~/.local/lib/python3.10/site-packages/

Is it possible that you were trying to install basix with pip, and it asked you/forced you to uninstall the version you had already installed?

If so