# Error running LinearProblem on poisson demo on MacOS-conda env

**URL:** <https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272>\
**Category:** dolfinx\
**Created:** [October 16, 2025, 6:33pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272 "2025-10-16T18:33:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 16, 2025, 6:33pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/1 "2025-10-16T18:33:04Z")

</div>

I am using the provided dolfinx conda env on macOS with the following dependencies :

```auto
# Name Version Build Channel
_python_abi3_support 1.0 hd8ed1ab_2 conda-forge
aiohappyeyeballs 2.6.1 pyhd8ed1ab_0 conda-forge
aiohttp 3.13.0 py311hdaf2c26_0 conda-forge
aiosignal 1.4.0 pyhd8ed1ab_0 conda-forge
aom 3.9.1 hf036a51_0 conda-forge
appnope 0.1.4 pyhd8ed1ab_1 conda-forge
asttokens 3.0.0 pyhd8ed1ab_1 conda-forge
attrs 25.4.0 pyh71513ae_0 conda-forge
blosc 1.21.6 hd145fbb_1 conda-forge
brotli 1.1.0 h1c43f85_4 conda-forge
brotli-bin 1.1.0 h1c43f85_4 conda-forge
brotli-python 1.1.0 py311h7b20566_4 conda-forge
bzip2 1.0.8 h500dc9f_8 conda-forge
c-ares 1.34.5 hf13058a_0 conda-forge
c-blosc2 2.21.3 h415348b_0 conda-forge
ca-certificates 2025.10.5 hbd8a1cb_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cairo 1.18.4 h950ec3b_0 conda-forge
cctools_osx-64 1024.3 llvm19_1_h3b512aa_5 conda-forge
certifi 2025.10.5 pyhd8ed1ab_0 conda-forge
cffi 1.16.0 py311hc0b63fd_0 conda-forge
cftime 1.6.4 py311h0e52b60_2 conda-forge
charset-normalizer 3.4.4 pyhd8ed1ab_0 conda-forge
clang 19.1.7 default_h1323312_5 conda-forge
clang-19 19.1.7 default_hc369343_5 conda-forge
clang_impl_osx-64 19.1.7 hc73cdc9_25 conda-forge
clang_osx-64 19.1.7 h7e5c614_25 conda-forge
cli11 2.5.0 h92383a6_0 conda-forge
comm 0.2.3 pyhe01879c_0 conda-forge
compiler-rt 19.1.7 he914875_1 conda-forge
compiler-rt_osx-64 19.1.7 h138dee1_1 conda-forge
contourpy 1.3.3 py311hd4d69bb_2 conda-forge
cpython 3.11.14 py311hd8ed1ab_1 conda-forge
cycler 0.12.1 pyhd8ed1ab_1 conda-forge
cyrus-sasl 2.1.28 h610c526_0 conda-forge
dav1d 1.2.1 h0dc2134_0 conda-forge
dbus 1.16.2 h27bd348_0 conda-forge
debugpy 1.8.17 py311h1854d6b_0 conda-forge
decorator 5.2.1 pyhd8ed1ab_0 conda-forge
double-conversion 3.3.1 h240833e_0 conda-forge
eigen 3.4.0 hfc0b2d5_1 conda-forge
exceptiongroup 1.3.0 pyhd8ed1ab_0 conda-forge
executing 2.2.1 pyhd8ed1ab_0 conda-forge
expat 2.7.1 h21dd04a_0 conda-forge
fenics-basix 0.9.0 py311h25152e5_4 conda-forge
fenics-basix-nanobind-abi 0.2.8.19 py313h70ed5a5_4 conda-forge
fenics-dolfinx 0.9.0 py311h3bbc424_118 conda-forge
fenics-ffcx 0.9.0 pyh2e48890_0 conda-forge
fenics-libbasix 0.9.0 py311h573253e_4 conda-forge
fenics-libdolfinx 0.9.0 py311haa1a4f7_118 conda-forge
fenics-ufcx 0.9.0 hb7f7608_0 conda-forge
fenics-ufl 2024.2.0 pyhd8ed1ab_1 conda-forge
ffmpeg 8.0.0 gpl_h5f853a7_106 conda-forge
fftw 3.3.10 mpi_openmpi_h3b45436_10 conda-forge
fmt 11.2.0 hbf61d64_0 conda-forge
font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge
font-ttf-inconsolata 3.000 h77eed37_0 conda-forge
font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge
font-ttf-ubuntu 0.83 h77eed37_3 conda-forge
fontconfig 2.15.0 h37eeddb_1 conda-forge
fonts-conda-ecosystem 1 0 conda-forge
fonts-conda-forge 1 0 conda-forge
fonttools 4.60.1 py311he13f9b5_0 conda-forge
freetype 2.14.1 h694c41f_0 conda-forge
fribidi 1.0.16 h8616949_0 conda-forge
frozenlist 1.7.0 py311h7a2b322_0 conda-forge
gdk-pixbuf 2.44.3 h07555a4_0 conda-forge
glslang 16.0.0 h4770549_0 conda-forge
gmp 6.3.0 hf036a51_2 conda-forge
graphite2 1.3.14 h21dd04a_2 conda-forge
h2 4.3.0 pyhcf101f3_0 conda-forge
h5py 3.15.1 nompi_py311hc8b82f0_100 conda-forge
harfbuzz 12.1.0 hc5d3ef4_0 conda-forge
hdf4 4.2.15 h8138101_7 conda-forge
hdf5 1.14.6 mpi_openmpi_h8bfb534_3 conda-forge
hpack 4.1.0 pyhd8ed1ab_0 conda-forge
hyperframe 6.1.0 pyhd8ed1ab_0 conda-forge
hypre 2.32.0 mpi_openmpi_ha6d64cb_1 conda-forge
icu 75.1 h120a0e1_0 conda-forge
idna 3.11 pyhd8ed1ab_0 conda-forge
importlib-metadata 8.7.0 pyhe01879c_1 conda-forge
importlib_metadata 8.7.0 h40b2b14_1 conda-forge
ipykernel 7.0.1 pyh5552912_0 conda-forge
ipython 9.6.0 pyhfa0c392_0 conda-forge
ipython_pygments_lexers 1.1.1 pyhd8ed1ab_0 conda-forge
jedi 0.19.2 pyhd8ed1ab_1 conda-forge
jsoncpp 1.9.6 h466cfd8_1 conda-forge
jupyter_client 8.6.3 pyhd8ed1ab_1 conda-forge
jupyter_core 5.9.0 pyhc90fa1f_0 conda-forge
kahip 3.19 h3e32c55_1 conda-forge
kiwisolver 1.4.9 py311ha94bed4_1 conda-forge
krb5 1.21.3 h37d8d59_0 conda-forge
lame 3.100 hb7f2c08_1003 conda-forge
lcms2 2.17 h72f5680_0 conda-forge
ld64_osx-64 955.13 llvm19_1_h466f870_5 conda-forge
lerc 4.0.0 hcca01a6_1 conda-forge
libabseil 20250512.1 cxx17_hfc00f1c_0 conda-forge
libadios2 2.10.2 mpi_openmpi_h8855da3_12 conda-forge
libaec 1.1.4 ha6bc127_0 conda-forge
libamd 3.3.3 ha5840a7_7100102 conda-forge
libass 0.17.4 h87c4fc2_0 conda-forge
libblas 3.9.0 37_he492b99_openblas conda-forge
libboost 1.88.0 hf9ddd82_5 conda-forge
libboost-devel 1.88.0 h7a7523a_5 conda-forge
libboost-headers 1.88.0 h694c41f_5 conda-forge
libbrotlicommon 1.1.0 h1c43f85_4 conda-forge
libbrotlidec 1.1.0 h1c43f85_4 conda-forge
libbrotlienc 1.1.0 h1c43f85_4 conda-forge
libbtf 2.3.2 hca54c18_7100102 conda-forge
libcamd 3.3.3 hca54c18_7100102 conda-forge
libcblas 3.9.0 37_h9b27e0a_openblas conda-forge
libccolamd 3.3.4 hca54c18_7100102 conda-forge
libcholmod 5.3.1 h7ea7d7c_7100102 conda-forge
libclang-cpp19.1 19.1.7 default_hc369343_5 conda-forge
libclang13 21.1.3 default_h7f9524c_0 conda-forge
libcolamd 3.3.4 hca54c18_7100102 conda-forge
libcurl 8.14.1 h5dec5d8_0 conda-forge
libcxx 21.1.3 h3d58e20_0 conda-forge
libdeflate 1.24 hcc1b750_0 conda-forge
libedit 3.1.20250104 pl5321ha958ccf_0 conda-forge
libev 4.33 h10d778d_2 conda-forge
libevent 2.1.12 ha90c15b_1 conda-forge
libexpat 2.7.1 h21dd04a_0 conda-forge
libfabric 2.2.0 h694c41f_2 conda-forge
libfabric1 2.2.0 h1c43f85_2 conda-forge
libffi 3.4.6 h281671d_1 conda-forge
libfreetype 2.14.1 h694c41f_0 conda-forge
libfreetype6 2.14.1 h6912278_0 conda-forge
libgfortran 15.2.0 h306097a_1 conda-forge
libgfortran5 15.2.0 h336fb69_1 conda-forge
libglib 2.86.0 h7cafd41_0 conda-forge
libhwloc 2.12.1 default_h094e1f9_1002 conda-forge
libiconv 1.18 h57a12c2_2 conda-forge
libintl 0.25.1 h3184127_1 conda-forge
libjpeg-turbo 3.1.0 h6e16a3a_0 conda-forge
libklu 2.3.5 hc7f8671_7100102 conda-forge
liblapack 3.9.0 37_h859234e_openblas conda-forge
libllvm19 19.1.7 h56e7563_2 conda-forge
libllvm21 21.1.3 h56e7563_0 conda-forge
liblzma 5.8.1 hd471939_2 conda-forge
liblzma-devel 5.8.1 hd471939_2 conda-forge
libnetcdf 4.9.3 nompi_habf9e57_103 conda-forge
libnghttp2 1.67.0 h3338091_0 conda-forge
libntlm 1.8 h6e16a3a_0 conda-forge
libogg 1.3.5 he3325bb_1 conda-forge
libopenblas 0.3.30 openmp_h6006d49_2 conda-forge
libopenvino 2025.2.0 h346e020_1 conda-forge
libopenvino-auto-batch-plugin 2025.2.0 heda8b29_1 conda-forge
libopenvino-auto-plugin 2025.2.0 heda8b29_1 conda-forge
libopenvino-hetero-plugin 2025.2.0 hd57c75b_1 conda-forge
libopenvino-intel-cpu-plugin 2025.2.0 h346e020_1 conda-forge
libopenvino-ir-frontend 2025.2.0 hd57c75b_1 conda-forge
libopenvino-onnx-frontend 2025.2.0 ha4fb624_1 conda-forge
libopenvino-paddle-frontend 2025.2.0 ha4fb624_1 conda-forge
libopenvino-pytorch-frontend 2025.2.0 hbc7d668_1 conda-forge
libopenvino-tensorflow-frontend 2025.2.0 hd87add6_1 conda-forge
libopenvino-tensorflow-lite-frontend 2025.2.0 hbc7d668_1 conda-forge
libopus 1.5.2 he3325bb_0 conda-forge
libpmix 5.0.8 h7a6afba_2 conda-forge
libpng 1.6.50 h84aeda2_1 conda-forge
libpq 18.0 h5a4e477_0 conda-forge
libprotobuf 6.31.1 h03562ea_2 conda-forge
libptscotch 7.0.10 int32_h4e72b04_1 conda-forge
librsvg 2.60.0 h2da6fc3_0 conda-forge
libscotch 7.0.10 int32_h0c4f589_1 conda-forge
libsodium 1.0.20 hfdf4475_0 conda-forge
libspqr 4.3.4 h795628b_7100102 conda-forge
libsqlite 3.50.4 h39a8b3b_0 conda-forge
libssh2 1.11.1 hed3591d_0 conda-forge
libsuitesparseconfig 7.10.1 h00e5f87_7100102 conda-forge
libtheora 1.1.1 hfdf4475_1006 conda-forge
libtiff 4.7.1 haa3b502_0 conda-forge
libumfpack 6.3.5 h0658b90_7100102 conda-forge
libusb 1.0.29 h2287256_0 conda-forge
libvorbis 1.3.7 ha059160_2 conda-forge
libvpx 1.14.1 hf036a51_0 conda-forge
libvulkan-loader 1.4.328.1 hfc0b2d5_0 conda-forge
libwebp-base 1.6.0 hb807250_0 conda-forge
libxcb 1.17.0 hf1f96e2_0 conda-forge
libxml2 2.15.0 h7b7ecba_1 conda-forge
libxml2-16 2.15.0 ha1d9b0f_1 conda-forge
libzip 1.11.2 h31df5bb_0 conda-forge
libzlib 1.3.1 hd23fc13_2 conda-forge
llvm-openmp 21.1.3 h472b3d1_0 conda-forge
llvm-tools 19.1.7 hb0207f0_2 conda-forge
llvm-tools-19 19.1.7 h879f4bc_2 conda-forge
loguru 0.7.3 pyh707e725_0 conda-forge
lz4-c 1.10.0 h240833e_1 conda-forge
markdown-it-py 4.0.0 pyhd8ed1ab_0 conda-forge
matplotlib-base 3.10.7 py311h48d7e91_0 conda-forge
matplotlib-inline 0.1.7 pyhd8ed1ab_1 conda-forge
mdurl 0.1.2 pyhd8ed1ab_1 conda-forge
meshio 5.3.5 pyhd8ed1ab_0 conda-forge
metis 5.1.0 h3023b02_1007 conda-forge
mpi 1.0.1 openmpi conda-forge
mpi4py 4.1.1 py311h2196963_100 conda-forge
msgpack-python 1.1.2 py311haec20ae_0 conda-forge
multidict 6.6.3 py311h1cc1194_0 conda-forge
mumps-include 5.8.1 h2999806_4 conda-forge
mumps-mpi 5.8.1 h2b2e079_4 conda-forge
munkres 1.1.4 pyhd8ed1ab_1 conda-forge
ncurses 6.5 h0622a9a_3 conda-forge
nest-asyncio 1.6.0 pyhd8ed1ab_1 conda-forge
netcdf4 1.7.3 nompi_py311h56167b5_100 conda-forge
nlohmann_json 3.12.0 h53ec75d_1 conda-forge
numpy 2.3.3 py311hf157cb9_0 conda-forge
openh264 2.6.0 h4883158_0 conda-forge
openjpeg 2.5.4 h87e8dc5_0 conda-forge
openldap 2.6.10 hd8a590d_0 conda-forge
openmpi 5.0.8 h0c582a8_108 conda-forge
openssl 3.5.4 h230baf5_0 conda-forge
packaging 25.0 pyh29332c3_1 conda-forge
pango 1.56.4 h6ef8af8_0 conda-forge
parmetis 4.0.3 h0844cba_1007 conda-forge
parso 0.8.5 pyhcf101f3_0 conda-forge
pcre2 10.46 ha3e7e28_0 conda-forge
petsc 3.24.0 real_h1baac1d_2 conda-forge
petsc4py 3.24.0 np2py310h29b8c15_0 conda-forge
pexpect 4.9.0 pyhd8ed1ab_1 conda-forge
pickleshare 0.7.5 pyhd8ed1ab_1004 conda-forge
pillow 11.3.0 py311ha88f94d_3 conda-forge
pip 25.2 pyh8b19718_0 conda-forge
pixman 0.46.4 ha059160_1 conda-forge
pkg-config 0.29.2 hf7e621a_1009 conda-forge
platformdirs 4.5.0 pyhcf101f3_0 conda-forge
pooch 1.8.2 pyhd8ed1ab_3 conda-forge
proj 9.7.0 h3124640_0 conda-forge
prompt-toolkit 3.0.52 pyha770c72_0 conda-forge
propcache 0.3.1 py311ha3cf9ac_0 conda-forge
psutil 7.1.0 py311hf197a57_0 conda-forge
pthread-stubs 0.4 h00291cd_1002 conda-forge
ptyprocess 0.7.0 pyhd8ed1ab_1 conda-forge
pugixml 1.15 h46091d4_0 conda-forge
pure_eval 0.2.3 pyhd8ed1ab_1 conda-forge
pycparser 2.22 pyh29332c3_1 conda-forge
pygments 2.19.2 pyhd8ed1ab_0 conda-forge
pyparsing 3.2.5 pyhcf101f3_0 conda-forge
pysocks 1.7.1 pyha55dd90_7 conda-forge
python 3.11.14 h3999593_1_cpython conda-forge
python-dateutil 2.9.0.post0 pyhe01879c_2 conda-forge
python-gil 3.11.14 hd8ed1ab_1 conda-forge
python_abi 3.11 8_cp311 conda-forge
pyvista 0.46.3 pyhd8ed1ab_1 conda-forge
pyzmq 27.1.0 py311h0ab6910_0 conda-forge
qhull 2020.2 h3c5361c_5 conda-forge
qt6-main 6.9.3 hac9256e_0 conda-forge
readline 8.2 h7cca4af_2 conda-forge
requests 2.32.5 pyhd8ed1ab_0 conda-forge
rich 14.2.0 pyhcf101f3_0 conda-forge
scalapack 2.2.0 hea3c4a5_4 conda-forge
scooby 0.10.2 pyhd8ed1ab_0 conda-forge
sdl2 2.32.56 h53ec75d_0 conda-forge
sdl3 3.2.24 h53c92ef_0 conda-forge
setuptools 80.9.0 pyhff2d567_0 conda-forge
shaderc 2025.4 hda4194c_0 conda-forge
sigtool 0.1.3 h88f4db0_0 conda-forge
six 1.17.0 pyhe01879c_1 conda-forge
slepc 3.24.0 real_h39f6dce_1 conda-forge
slepc4py 3.24.0 np2py310h09cc115_0 conda-forge
snappy 1.2.2 h25c286d_0 conda-forge
spdlog 1.15.3 hcdbecca_1 conda-forge
spirv-tools 2025.4 hcb651aa_0 conda-forge
sqlite 3.50.4 h64b5abc_0 conda-forge
stack_data 0.6.3 pyhd8ed1ab_1 conda-forge
superlu 7.0.0 h9cb3e3b_1 conda-forge
superlu_dist 9.1.0 h5ad7ff3_0 conda-forge
svt-av1 3.1.2 h21dd04a_0 conda-forge
tapi 1300.6.5 h390ca13_0 conda-forge
tbb 2022.2.0 hc025b3e_1 conda-forge
tbb-devel 2022.2.0 h1f2c84b_1 conda-forge
tk 8.6.13 hf689a15_2 conda-forge
tornado 6.5.2 py311h13e5629_1 conda-forge
traitlets 5.14.3 pyhd8ed1ab_1 conda-forge
typing-extensions 4.15.0 h396c80c_0 conda-forge
typing_extensions 4.15.0 pyhcf101f3_0 conda-forge
tzdata 2025b h78e105d_0 conda-forge
unicodedata2 16.0.0 py311h13e5629_1 conda-forge
urllib3 2.5.0 pyhd8ed1ab_0 conda-forge
utfcpp 4.0.8 h694c41f_0 conda-forge
vtk 9.5.1 h928d209_7 conda-forge
vtk-base 9.5.1 py311hb809fa1_7 conda-forge
vtk-io-ffmpeg 9.5.1 h44b3099_7 conda-forge
wcwidth 0.2.14 pyhd8ed1ab_0 conda-forge
wheel 0.45.1 pyhd8ed1ab_1 conda-forge
wslink 2.4.0 pyhd8ed1ab_0 conda-forge
x264 1!164.3095 h775f41a_2 conda-forge
x265 3.5 hbb4e6a2_3 conda-forge
xorg-libxau 1.0.12 h6e16a3a_0 conda-forge
xorg-libxdmcp 1.1.5 h00291cd_0 conda-forge
yaml 0.2.5 h4132b18_3 conda-forge
yarl 1.20.1 py311ha3cf9ac_0 conda-forge
zeromq 4.3.5 h6c33b1e_9 conda-forge
zfp 1.0.1 h326e263_3 conda-forge
zipp 3.23.0 pyhd8ed1ab_0 conda-forge
zlib 1.3.1 hd23fc13_2 conda-forge
zlib-ng 2.2.5 he7f0fdc_0 conda-forge
zstandard 0.25.0 py311h62e9434_0 conda-forge
zstd 1.5.7 h8210216_2 conda-forge

```

I am getting the following error once getting to the linearProblem:

```auto
Exception ignored in: <function LinearProblem. __del__ at 0x172d884a0>
Traceback (most recent call last):
  File "/Users/Hawraa_1/opt/anaconda3/envs/fenicsx-env/lib/python3.11/site-packages/dolfinx/fem/petsc.py", line 831, in __del__
    self._solver.destroy()
    ^^^^^^^^^^^^
AttributeError: 'LinearProblem' object has no attribute '_solver'

```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 17, 2025, 7:14am UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/2 "2025-10-17T07:14:16Z")

</div>

Could you give the full error traceback? This error usually happens whenever something else fails in the construction of `LinearProblem`, which shuts down the class before `self._solver` has been initialized. I’ve just made a PR to make this clearer with: [Safer handling of PETSc destruction in high-level classes by jorgensd · Pull Request #3951 · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/pull/3951)

---

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 17, 2025, 1:28pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/3 "2025-10-17T13:28:28Z")

</div>

I am running the python demo with ipynb, all cells before ran with no errors until this one. Let me know if this makes it clear or if you would like me to run a separate test.

```auto
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[10], line 1
----> 1 problem = LinearProblem(
      2 a,
      3 L,
      4 bcs=[bc],
      5 petsc_options_prefix="demo_poisson_",
      6 petsc_options={"ksp_type": "preonly", "pc_type": "lu", "ksp_error_if_not_converged": True},
      7 )
      8 uh = problem.solve()
      9 assert isinstance(uh, fem.Function)

TypeError: LinearProblem. __init__ () got an unexpected keyword argument 'petsc_options_prefix'

```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 17, 2025, 1:43pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/4 "2025-10-17T13:43:48Z")

</div>

Remove the argument `petsc_options_prefix` from the LinearProblem initializer. This is a new keyword that will be mandatory in v0.10 (or currently the main branch).

---

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 17, 2025, 2:19pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/5 "2025-10-17T14:19:23Z")

</div>

Now I get an attribute error :

```auto
AttributeError Traceback (most recent call last)
Cell In[11], line 1
----> 1 problem = LinearProblem(
      2 a,
      3 L,
      4 bcs=[bc],
      5 petsc_options={"ksp_type": "preonly", "pc_type": "lu", "ksp_error_if_not_converged": True},
      6 )
      7 uh = problem.solve()
      8 assert isinstance(uh, fem.Function)

File ~/opt/anaconda3/envs/fenicsx-env/lib/python3.11/site-packages/dolfinx/fem/petsc.py:788, in LinearProblem. __init__ (self, a, L, bcs, u, petsc_options, form_compiler_options, jit_options)
    754 """Initialize solver for a linear variational problem.
    755 
    756 Args:
   (...) 780 "mumps"})
    781 """
    782 self._a = _create_form(
    783 a,
    784 dtype=PETSc.ScalarType,
    785 form_compiler_options=form_compiler_options,
    786 jit_options=jit_options,
    787 )
--> 788 self._A = create_matrix(self._a)
...
--> 176 return _cpp.fem.petsc.create_matrix(a._cpp_object)
    177 else:
    178 return _cpp.fem.petsc.create_matrix(a._cpp_object, mat_type)

AttributeError: 'NoneType' object has no attribute '_cpp_object'

```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 17, 2025, 2:33pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/6 "2025-10-17T14:33:11Z")

</div>

Now I need your code to reproduce the example, s I don’t know what the a you are sending in is

---

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 17, 2025, 4:31pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/7 "2025-10-17T16:31:20Z")

</div>

running exactly the ipynb for poisson, just changed the following :

```auto
problem = LinearProblem(
    a,
    L,
    bcs=[bc],
    petsc_options={"ksp_type": "preonly", "pc_type": "lu", "ksp_error_if_not_converged": True},
)
uh = problem.solve()
assert isinstance(uh, fem.Function)

```

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 17, 2025, 4:42pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/8 "2025-10-17T16:42:28Z")

</div>

Could you give me a link to what Poisson demo you have downloaded? There are quite a few versions out there.

---

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 17, 2025, 4:43pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/9 "2025-10-17T16:43:18Z")

</div>

I used the one on here : [Poisson equation — DOLFINx 0.10.0.0 documentation](https://docs.fenicsproject.org/dolfinx/main/python/demos/demo_poisson.html)

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [October 17, 2025, 4:55pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/10 "2025-10-17T16:55:42Z")

</div>

Since you are using version 0.9, you should download it from [Poisson equation — DOLFINx 0.9.0 documentation](https://docs.fenicsproject.org/dolfinx/v0.9.0/python/demos/demo_poisson.html)

---

<div class="post-metadata">

**Author:** ![Hawraa17](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/hawraa17/32/8907_2.png) [@Hawraa17](https://fenicsproject.discourse.group/u/Hawraa17)\
**Post date:** [October 17, 2025, 4:59pm UTC](https://fenicsproject.discourse.group/t/error-running-linearproblem-on-poisson-demo-on-macos-conda-env/18272/11 "2025-10-17T16:59:18Z")

</div>

yes that one works great! thank you for your assistance!
