I am getting an error recently.
import dolfinx
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[3], line 1
----> 1 import dolfinx
File /usr/lib/petsc/lib/python3/dist-packages/dolfinx/__init__.py:34
30 else:
31 return output
---> 34 pusimp.prevent_user_site_imports(
35 "dolfinx", "apt", "https://fenicsproject.discourse.group/",
36 "/usr/lib/python3/dist-packages",
37 ["basix", "ffcx", "ufl"],
38 ["fenics-basix", "fenics-ffcx", "fenics-ufl"],
39 [False, False, False],
40 ["", "", ""],
41 pip_uninstall_call
42 )
44 del pip_uninstall_call, pusimp
46 from dolfinx import common
File /usr/lib/python3/dist-packages/pusimp/prevent_user_site_imports.py:187, in prevent_user_site_imports(package_name, system_manager, contact_url, dependencies_expected_prefix, dependencies_import_name, dependencies_pypi_name, dependencies_optional, dependencies_extra_error_message, pip_uninstall_call)
171 if counter_error_categories > 1:
172 import_error = (
173 f"pusimp has detected the following problems with {package_name} dependencies:\n"
174 f"{missing_dependencies_error}"
(...)
185 f"If you believe that this message appears incorrectly, report this at {contact_url} ."
186 )
--> 187 raise ImportError(import_error)
ImportError: pusimp has detected the following problems with dolfinx dependencies:
1) Dependencies imported from a local path rather than from the path provided by apt:
* ufl was imported from a local path: expected in /usr/lib/python3/dist-packages/ufl/__init__.py, but imported from /home/bagla0/.local/lib/python3.10/site-packages/fenics_ufl-2019.1.0-py3.10.egg/ufl/__init__.py.
pusimp suggests to apply all of the following fixes:
1) To uninstall local dependencies:
* run 'pip uninstall fenics-ufl' in a terminal, and verify that you are prompted to confirm removal of files in /home/bagla0/.local/lib/python3.10/site-packages/fenics_ufl-2019.1.0-py3.10.egg/ufl.
You can disable this check by exporting the DOLFINX_ALLOW_USER_SITE_IMPORTS environment variable. Note, however, that this may break the installation provided by apt.
If you believe that this message appears incorrectly, report this at https://fenicsproject.discourse.group/ .
I have uninstalled using pip uninstall fenics-ufl
in terminal, but, the error remains same. I don’t know what wrong I did. I remember, I updated the doflinx only. I also reinstalled fenicsx in my ubuntu, but, it doesn’t work