Reputation: 6927
I am using Python 3.2 under Windows 7. I need some numerical subroutines for my Python script, and I would like to write them in Fortran and use f2py to make them compatible with my script.
As per the f2py documentation, I installed numpy (v1.6.1), then tried running f2py
on the command line to check the installation. Windows keeps telling me that "f2py is not recognized as an internal or external command, operable program, or batch file." I tried adding "C:\Python32\Scripts" to my PATH, but that didn't help. (C:\Python32 is my Python installation directory, and is also in my PATH, numpy is also installed here)
What am I doing wrong?
Upvotes: 2
Views: 7782
Reputation: 831
In 2016, you should be able to run f2py
as an executable numpy module from the command line:
python -m numpy.f2py
This avoids needing to mess around with environment variables, and works on my Windows machine with numpy 1.10.4.
(Further discussion: https://github.com/numpy/numpy/pull/5565, https://github.com/numpy/numpy/issues/7532)
Upvotes: 1
Reputation: 34260
You need to run f2py.py
. If you want to omit the .py extension, add .PY
to your PATHEXT
environment variable.
Upvotes: 5
Reputation: 12068
did you try f2py.py ? or "python f2py.py" or "python f2py"? depending on the file and if you have windows use python to open py ext files
Upvotes: 0