0

This may seem to be a rather odd issue, but I have a fully functional Python with Numpy on my Mac, and the Numpy has f2py included in it. I can even access f2py by importing it explicitly on my iPython window as

from numpy import f2py

But I cannot run f2py from my terminal. Could someone suggest what to do?

Thanks

computanjohn
  • 133
  • 8
  • Possibly you have more than one python version/environment and are accessing different versions via ipython vs standard terminal? – JohnE Apr 05 '15 at 21:13

1 Answers1

0

One way would be to find where that f2py is that you can import in ipython: After importing f2py in ipython, just type f2py, and it should show you the location of the numpy installation. From that, you should be able to find the f2py binary.

For example, from within ipython, my f2py is in:

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/f2py/__init__.pyc

From here, we can see that the executable f2py will be in

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/f2py

As JohnE said, perhaps you have more than one python environment, and the one with f2py in it is not in your path?

tmdavison
  • 64,360
  • 12
  • 187
  • 165
  • On my system (Sierra) the executable is under `/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/bin` – superk Jan 24 '17 at 08:44