CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Python and paraview.simple libprotobuf error (https://www.cfd-online.com/Forums/paraview/179227-python-paraview-simple-libprotobuf-error.html)

Private Mandella October 25, 2016 19:28

Python and paraview.simple libprotobuf error
 
I want to automate my use of paraview using python. I'm using Python 2.7, Paraview 3.14.1 on Ubuntu 12.04 LTS. However, I am having problems loading the required modules to write the python script. I was initially able to load paraview.simple a few times, then I received the errors described below. I tried restarting Ubuntu. A shot in the dark, I know, but I don't know what else to do. I just tried to load some of the other modules: paraview.pvfilters, paraview.vtk, and paraview.util loaded; while paraview.servermanager gave the same error as paraview.simple.

When I run
Code:

import paraview.simple
I get
Code:

libprotobuf ERROR /build/buildd/paraview3.14.1/Utilities/protobuf/src/google/protobuf/descriptor_database.cc:57]
File already exists in database: vtkPVMessage.proto
libprotobuf FATAL /build/buildd/paraview3.14.1/Utilities/protobuf/src/google/protobuf/descriptor.cc:860]
CHECK failed: generated_database_>Add(encoded_file_descriptor, size):
Aborted (core dumped)

If I run
Code:

import paraview
help(paraview)

I get
Code:

NAME
    paraview

FILE
    /usr/lib/python2.7/dist-packages/paraview/__init__.py

MODULE DOCS
    http://docs.python.org/library/paraview

DESCRIPTION
    This module is not meant to be used directly. Please look at one of the modules
    it provides:
        servermanager
        pvfilters
        vtk
        numeric
        util
        simple
    :

And then
Code:

    help(paraview.simple)
    AttributeError: 'module' has no attribute 'simple'

The file "simple.py" and "simple.pyc" are in the paraview folder indicated by help(paraview).
I should probably note the recommended way to load the module
Code:

    try: paraview.simple
    except: from paraview.simple import *

returns the same libprotobuf error as described above. Since I can access the paraview module, it seems as though there is an issue with a library that simple is calling? Maybe? I have no idea what any of this means. Thanks for any help.

Edit
I'm going to try to see if following the rabbit hole from this https://github.com/BVLC/caffe/issues/1917 will fix the issue.

Private Mandella October 26, 2016 13:25

Version control
 
The error must be with the version that the module loads from. When I run the scripts as using pvpython instead of python, the module loads correctly and indicates that the version is 4.1.


All times are GMT -4. The time now is 07:36.