Hello and thank you for all your work on FEniCS. I tried to
install it through anaconda using "conda install -c conda-forge fenics".
The installation seemed to succeed, installing version 2017.1.0-py36_5.
However,
when I started python and issued "from fenics import *" I got
"RuntimeError: module compiled against API version 0xb but this version
of numpy is 0xa".
Furthermore, I got another exception during handling of the one above: "ModuleNotFoundError: No module named '_common'".
I have numpy version 1.12.1, which is what was
there before the FEniCS installation, although the numpy package itself
was replaced with one from conda forge during the FEniCS installation.
Also, I can do 'import numpy.core.multiarray' at the python prompt without an error. That module's __version__ is 3.1.
If I understand correctly (which I may not), the numpy API version 0xb corresponds to numpy version 1.13 or above. Reference:
https://github.com/numpy/numpy/blob/master/numpy/core/code_generators/cversions.txtI've copied the complete traceback below. I'm using ubuntu 16.04 LTS and conda 4.3.23 in case that helps.
Thanks again,
Tom Pace
-----------------
>>> from fenics import *
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa
Traceback (most recent call last):
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/dolfin/cpp/common.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "/u1/tgpa222/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
File "<frozen importlib._bootstrap>", line 560, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
ImportError: numpy.core.multiarray failed to import
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/fenics/__init__.py", line 7, in <module>
from dolfin import *
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/dolfin/__init__.py", line 17, in <module>
from . import cpp
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/dolfin/cpp/__init__.py", line 43, in <module>
exec("from . import %s" % module_name)
File "<string>", line 1, in <module>
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/dolfin/cpp/common.py", line 21, in <module>
_common = swig_import_helper()
File "/u1/tgpa222/anaconda3/lib/python3.6/site-packages/dolfin/cpp/common.py", line 20, in swig_import_helper
return importlib.import_module('_common')
File "/u1/tgpa222/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_common'