Ubuntu 18.04 - ImportError: cannot import name 'sub_forms_by_domain'

I’m late to the discussion, but you can also just see where python is picking up your package and remove it if necessary. Your PYTHONPATH be be prioritising directories containing old versions.

e.g. for me:

:~$ python3 -c "import ufl; print(ufl.__file__)"
$HOME/local/lib/python3.8/site-packages/fenics_ufl-2019.2.0.dev0-py3.8.egg/ufl/__init__.py

also worth checking your PYTHONPATH to see if there’s something there which shouldn’t be

echo $PYTHONPATH
1 Like