[petsc-users] A combined petsc4py, FEniCS, and Firedrake issue

Justin Chang jychang48 at gmail.com
Tue Jul 14 03:24:09 CDT 2015


Hi everyone,

As the title says, I have an issue regarding all three. Not sure which
mailing to post this to but i figured somebody here may help.

I was attempting to install Firedrake on my Ubuntu PC, so far it has not
worked yet. However, after my failed attempt, i tried to run some of my old
FEniCS programs, and something within the Dolfin library has screwed up.
Below is the error:

Traceback (most recent call last):
  File "Idealized_reservoir.py", line 8, in <module>
    from dolfin import *
  File "/usr/lib/python2.7/dist-packages/dolfin/__init__.py", line 16, in
<module>
    from . import cpp
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp/__init__.py", line 42,
in <module>
    exec("from . import %s" % module_name)
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp/common.py", line 32, in
<module>
    _common = swig_import_helper()
  File "/usr/lib/python2.7/dist-packages/dolfin/cpp/common.py", line 28, in
swig_import_helper
    _mod = imp.load_module('_common', fp, pathname, description)
  File "/usr/local/lib/python2.7/dist-packages/petsc4py/PETSc.py", line 4,
in <module>
    PETSc._initialize()
  File "PETSc/PETSc.pyx", line 407, in petsc4py.PETSc._initialize
(src/petsc4py.PETSc.c:232527)
  File "PETSc/PETSc.pyx", line 395, in petsc4py.PETSc.register
(src/petsc4py.PETSc.c:232364)
  File "PETSc/Object.pyx", line 257, in petsc4py.PETSc.PyPetscType_Register
(src/petsc4py.PETSc.c:64906)
ValueError: key: 0, cannot register: <type 'petsc4py.PETSc.Partitioner'>,
already registered: None

It seems I screwed something up when I attempted to installed petsc4py. The
following command was used to install petsc4py per firedrake instructions:

sudo pip install
git+https://bitbucket.org/mapdes/petsc4py.git@firedrake#egg=petsc4py

I tried uninstalling petsc4py via sudo pip uninstall but it says "Not
uninstalling petsc4py at /usr/lib/pymodules/python2.7, owned by OS". I
reinstalled fenics/dolfin and all of its dependencies but i still get the
traceback errors above. I tried to upgrade petsc4py sudo pip install -U
--no-deps ... but it says "Can't roll back petsc4py; was not uninstalled".

Any idea what I can do here?

Thanks,
Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150714/238a2981/attachment-0001.html>


More information about the petsc-users mailing list