Rethliopuks
Rethliopuks

Reputation: 125

f2py: command not found

Mac OS Sierra.

In terminal, while trying to execute a .sh file that involves a Python script with Fortran portions, I got this message:

lenscov-master Roger$ ./run_covariances.sh recompile
rm *.o *.so
rm: *.so: No such file or directory
make: [clean] Error 1 (ignored)
gfortran -fPIC -c *.f -lgfortran -lifcore
f2py-2.7 -c loop_lensing.f90 *.o -m loop_lensing --opt=-ffixed-line-length-
none --opt=-O3
/bin/sh: f2py-2.7: command not found
make: *** [loop_lensing] Error 127

However, it is fine just test-running the .f90 file:

f2py -c loop_lensing.F90 -m test

returns a bunch of normal-looking information.

Does anyone maybe know what is going on?

Upvotes: 0

Views: 1338

Answers (2)

foodtooth
foodtooth

Reputation: 146

it is fine just test-running the .f90 file

means you have f2py installed. But the script use f2py-2.7

You need to check the version of installed f2py, and make sure f2py-2.7 redirects to the corrent f2py.

Upvotes: 3

The script (or a Makefile) tries to invoke f2py-2.7 instead of f2py. If it is your script or you can easily adjust it, rename all f2py-2.7 to f2py. Otherwise you have to tell us more about the script and show the code of the script.

As foodtooth says, make sure you have f2py 2.7 and not f2py-3, but I don't expect that to be a problem.

You could also make a symlink f2py -> f2py-2.7 for the script.

Upvotes: 1

Related Questions