Opened 10 years ago
Closed 9 years ago
#47300 closed defect (worksforme)
dolfin: ImportError: cannot import name common
Reported by: | ljofre2146@… | Owned by: | seanfarley (Sean Farley) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.3 |
Keywords: | Cc: | ljofre2146@…, gideonsimpson | |
Port: | dolfin |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Hello to all:
my problem is for import dolfin module in a habitual project. This package was installed from macport in osx yosemite
sudo port install dolfin
when I try use the dolfin module I got the next message
import dolfin as df
Traceback (most recent call last): File "/Users/leonardojofre/Documents/mpi4py course/ejemplos petsc/example00001.py", line7, in <module> import dolfin as df File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/__init__.py", line 16, in <module> from . import cpp File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/cpp/__init__.py", line 42, in <module> exec("from . import %s" % module_name) File "<string>", line 1, in <module> ImportError: cannot import name common
it is a installation problem or is a bug?
thanks to all
Change History (13)
comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Component: | contrib → ports |
---|---|
Description: | modified (diff) |
Keywords: | dolfin python removed |
Owner: | changed from macports-tickets@… to sean@… |
Priority: | High → Normal |
Summary: | Problem to import dolfin intalled on macport → dolfin: ImportError: cannot import name common |
comment:2 Changed 10 years ago by ljofre2146@…
Cc: | ljofre2146@… added |
---|
comment:3 Changed 9 years ago by gideonsimpson
Has there been any update on this? I'm finding that I get that error too, and I'm using the most recently updated dolfin on one of my machines. I get the error:
>>> import dolfin Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/__init__.py", line 16, in <module> from . import cpp File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/cpp/__init__.py", line 42, in <module> exec("from . import %s" % module_name) File "<string>", line 1, in <module> ImportError: cannot import name common
comment:4 Changed 9 years ago by seanfarley (Sean Farley)
Sorry, this fell off my radar. I'll try to reproduce locally.
comment:5 follow-up: 6 Changed 9 years ago by seanfarley (Sean Farley)
I can't reproduce this locally. Is this due to the structure of the python project you're using (mpi4py course)? Is that someone online where I can download and try?
comment:6 Changed 9 years ago by gideonsimpson
Replying to sean@…:
I can't reproduce this locally. Is this due to the structure of the python project you're using (mpi4py course)? Is that someone online where I can download and try?
I'm not using mpi4py.
comment:7 Changed 9 years ago by seanfarley (Sean Farley)
Ok, I guess I was confused by the "mpi4py course" in your path. What are the exact options you used to compile dolfin? And is the "ejemplos petsc" folder online somewhere?
comment:8 Changed 9 years ago by gideonsimpson
I have dolfin @1.5.0_2+cgal+mpich+petsc+slepc+suitesparse installed. Not sure where I should look for ejemplos petsc.
comment:9 Changed 9 years ago by seanfarley (Sean Farley)
The first line of your traceback is "/Users/leonardojofre/Documents/mpi4py course/ejemplos petsc/example00001.py" ... can you run (from your home directory) python -c 'import dolfin'
and see if that works?
comment:10 Changed 9 years ago by gideonsimpson
The original poster was doing something with mpi4py; I am not. When I do the suggested command, I get:
:~$ python -c 'import dolfin' Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/__init__.py", line 16, in <module> from . import cpp File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/dolfin/cpp/__init__.py", line 42, in <module> exec("from . import %s" % module_name) File "<string>", line 1, in <module> ImportError: cannot import name common
comment:12 follow-up: 13 Changed 9 years ago by gideonsimpson
After blowing away my entire macports instllation, and reinstalling everything, it now seems to work. I still have no idea where the problem began.
comment:13 Changed 9 years ago by seanfarley (Sean Farley)
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Replying to gideon.simpson@…:
After blowing away my entire macports instllation, and reinstalling everything, it now seems to work. I still have no idea where the problem began.
My best guess is that something installed some python package that conflicted with dolfin :-/ Glad it's working now :-)
Cc Me!