This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

FEniCS installed from source does not work with scipy?

+1 vote

In order to use FEniCS 1.5 on debian I've installed from source using

curl -s http://fenicsproject.org/fenics-install.sh | bash

and source fenics.stable. It works fine except i am no longer able to use the scipy module. If i try to import it, i get the error:

ImportError: No module named scipy

Any hints on how to use scipy with FEniCS installed from source?

asked Mar 24, 2015 by ASN FEniCS Novice (630 points)

1 Answer

0 votes
 
Best answer

The reason is that sourcing fenics.stable will set your PYTHONPATH to point to the directory where fenics-install.sh puts its Python installation (located in a folder under ~/.hashdist).

It should work to add your default Python installation at the end of your PYTHONPATH like so:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages

(Adjust to where Python is located on your machine.)

answered Mar 24, 2015 by logg FEniCS Expert (11,790 points)
selected Mar 24, 2015 by ASN

Added

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages

to make it work. Thanks!

I have the same issue on my Mac.

In my Mac OS, it has neither /usr/lib/python2.7/site-packages nor /usr/lib/python2.7/dist-packages. Any reason?

If I just add path "/usr/bin" where the system python is, it still does not work.

...