i'm pretty new python (~4 months) , i'm trying use fortran subroutines in python i'm having major problems using f2py. have looked through documentation can't make heads or tails of why i'm getting errors i'm getting. created small fortran file hello.f
c file hello.f subroutine foo (a) integer print*, "hello fortran!" print*, "a=",a end and command line i'm trying use command:
f2py -c -m hello hello.f but i'm getting output:
f:\home\tsansom\projects\pytxblend>f2py -c -m hello hello.f running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "hello" sources f2py options: [] f2py:> c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7\hellomodule.c creating c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7 reading fortran codes... reading file 'hello.f' (format:fix,strict) post-processing... block: hello block: foo post-processing (stage 2)... building modules... building module "hello"... constructing wrapper function "foo"... foo(a) wrote c/api module "hello" file "c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7\hellomodule.c" adding 'c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7\fortranobject.c' sources. adding 'c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7' include_dirs. copying c:\anaconda\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7 copying c:\anaconda\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\users\tsansom\appdata\local\temp\tmpt8nrxn\src.win-amd64-2.7 build_src: building npy-pkg config files running build_ext no module named msvccompiler in numpy.distutils; trying distutils customize msvccompiler customize msvccompiler using build_ext unexpected valueerror in c:\anaconda\lib\site-packages\numpy\distutils\fcompiler\compaq.pyc traceback (most recent call last): file "c:\anaconda\scripts\f2py-script.py", line 23, in <module> main() file "c:\anaconda\lib\site-packages\numpy\f2py\f2py2e.py", line 590, in main run_compile() file "c:\anaconda\lib\site-packages\numpy\f2py\f2py2e.py", line 576, in run_compile setup(ext_modules = [ext]) file "c:\anaconda\lib\site-packages\numpy\distutils\core.py", line 169, in setup return old_setup(**new_attr) file "c:\anaconda\lib\distutils\core.py", line 151, in setup dist.run_commands() file "c:\anaconda\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) file "c:\anaconda\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() file "c:\anaconda\lib\site-packages\numpy\distutils\command\build.py", line 39, in run old_build.run(self) file "c:\anaconda\lib\distutils\command\build.py", line 127, in run self.run_command(cmd_name) file "c:\anaconda\lib\distutils\cmd.py", line 326, in run_command self.distribution.run_command(command) file "c:\anaconda\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() file "c:\anaconda\lib\site-packages\numpy\distutils\command\build_ext.py", line 195, in run c_compiler=self.compiler) file "c:\anaconda\lib\site-packages\numpy\distutils\fcompiler\__init__.py", line 837, in new_fcompiler load_all_fcompiler_classes() file "c:\anaconda\lib\site-packages\numpy\distutils\fcompiler\__init__.py", line 740, in load_all_fcompiler_classes __import__ (module_name) file "c:\anaconda\lib\site-packages\numpy\distutils\fcompiler\compaq.py", line 57, in <module> class compaqvisualfcompiler(fcompiler): file "c:\anaconda\lib\site-packages\numpy\distutils\fcompiler\compaq.py", line 100, in compaqvisualfcompiler raise e valueerror: [u'path', u'lib'] anyone know error means? admittedly don't know i'm doing i'm trying learn. in advance help, it's appreciated. thanks
Comments
Post a Comment