Error when running


I wanted to generate power-law viscoelastic material properties for my model. To test thing out I ran the example case by executing inside the ~/PyLith/pylith-2.2.2-darwin-10.13.6/src/pylith-2.2.2/examples/3d/hex8/spatialdb/powerlaw directory but the following error appears:

Traceback (most recent call last):
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/bin/”, line 32, in
class PowerLawApp(Application):
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/bin/”, line 72, in PowerLawApp
from spatialdata.spatialdb.SimpleDB import SimpleDB
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/”, line 23, in
from SpatialDBObj import SpatialDBObj
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/”, line 24, in
from spatialdb import SpatialDB as ModuleSpatialDB
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/”, line 28, in
_spatialdb = swig_import_helper()
File “/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/”, line 24, in swig_import_helper
_mod = imp.load_module(’_spatialdb’, fp, pathname, description)
ImportError: dlopen(/Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/, 2): Library not loaded: @executable_path/…/lib/libspatialdata.0.dylib
Referenced from: /Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/
Reason: unsafe use of @executable_path in /Users/Alpine/PyLith/pylith-2.2.2-darwin-10.13.6/lib/python2.7/site-packages/spatialdata/spatialdb/ with restricted binary

I installed pylith by simply doing “source”. I wonder what causes this error and how can I resolve it?

Thanks in advance

This is a Mac security issue.

@knepley Do you know how to solve this?

The problem here is that the dependent library path (@executable_path/…/lib/libspatialdata.0.dylib) has not been rewritten in the spatialdata Python module. This happens during the installation of spatialdata. Something went wrong there. I would reinstall it.


1 Like

I see the problem.

The first line of bin/ should be
#!/usr/bin/env nemesis
#!/usr/bin/env python

You will need to edit the file to fix this. This will give the correct path to libspatialdata.0.dylib. Be sure to invoke the script directly. That is, use, not python This has been fixed in the master branch, but we didn’t do a new release just to fix this script.

1 Like

This works! Now it is producing .spatialdb file.

Thank you!