astrojuanlu / fenics-recipes

This repository contains conda recipes for the FEniCS libraries
The Unlicense
13 stars 15 forks source link

Unable to import the Python Scientific module required by FIAT #30

Closed sakhan007 closed 9 years ago

sakhan007 commented 9 years ago

Would you please help in getting rid of this error!!

$ python 2ndorder_linear.py 
Traceback (most recent call last):
 File "2ndorder_linear.py", line 1, in <module>
 from dolfin import *
 File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/dolfin/__init__.py", line 4, in <module>
import dolfin.importhandler
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/dolfin/importhandler/__init__.py", line 39, in <module>
__import__(dep)
 File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/ffc/__init__.py", line 18, in <module>
from ffc.compiler import compile_form, compile_element
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/ffc/compiler.py", line 127, in <module>
from ffc.analysis import analyze_forms, analyze_elements
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/ffc/analysis.py", line 42, in <module>
from ffc.quadratureelement import default_quadrature_degree
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/ffc/quadratureelement.py", line 27, in <module>
from FIAT.functional import PointEvaluation
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/FIAT/__init__.py", line 11, in <module>
from FIAT.finite_element import FiniteElement
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/FIAT/finite_element.py", line 19, in <module>
from .polynomial_set import PolynomialSet
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/FIAT/polynomial_set.py", line 29, in <module>
from . import expansions
File "/home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/FIAT/expansions.py", line 34, in <module>
""")
Exception: Unable to import the Python Scientific module required by FIAT.
Consider installing the package python-scientific.
astrojuanlu commented 9 years ago

Hello @sakhan007, would you please paste here the result of

>>> import Scientific

and, if it fails, conda list?

sakhan007 commented 9 years ago

Here it is: http://pastebin.com/bqKZcC4G As you can see at the end, scientificpython is already among the conda packages.

sakhan007 commented 9 years ago

Hey Juanlu001, thanks for looking into it. I just have another look at my first post and found this:

File /home/sohail/learning/FEM/FEniCS/lib/python2.7/site-packages/dolfin/__init__.py

and this left me wondering, why this location is being used. I had a clone of fenics in /home/sohail/learning/FEM/ and this is forcing python to go there instead of /anaconda/. Once the fenics clone is moved out, I can run my programs.

astrojuanlu commented 9 years ago

Oh, the problem was fixed then? :grin:

Probably there's something in your PATH variable (try

$ echo $PATH

to check). Next time you can try using a conda environment, to isolate everything except what you want.

Closing!

sakhan007 commented 9 years ago

Thanks!!!!

astrojuanlu commented 9 years ago

Sorry, didn't look at the log until now. You mistyped Scientific and wrote Scientfic instead, by the way.

Python starts its search using an environment variable called PYTHONPATH, and if someone manually prepended a path to that variable it will be used first. You can check in Bash (outside Python) typing:

(fenics27)sohail@sohail-Inspiron-620:~$ echo $PYTHONPATH
sakhan007 commented 9 years ago

You are right, fenics.conf was being executed from the clone in .bashrc. Apologies.

astrojuanlu commented 9 years ago

You are welcome! I am glad I could help :smile: