f2py broken by python2.6

Bug #381005 reported by Tom Dimiduk
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-numpy (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: python-numpy

Ubuntu 9.04

The version of f2py in numpy 1.2.1 doesn't work with python 2.6 there may be other things broken as well as numpy didn't support fully python 2.6 until version 1.3 (http://sourceforge.net/project/shownotes.php?release_id=673613&group_id=1369). Could the packaged numpy be upgraded to 1.3, or the current version set to use python2.5?

Revision history for this message
Tom Dimiduk (tdimiduk) wrote :

modifying /usr/bin/f2py2.5 so that the first line is
#! /usr/bin/python2.5

fixes the problem, so that might make a stopgap fix, but really numpy just needs to upgrade to 1.3

Revision history for this message
Ariel (ariel-arielbalter) wrote :
Download full text (7.9 KiB)

Still having problems with f2py and python 2.6.2.
My Steps:
1. Installed f2py with # aptitude install f2py
1.5 tested f2py
abalter@scibox:~/Fortran$ f2py
Usage:

1) To construct extension module sources:

      f2py [<options>] <fortran files> [[[only:]||[skip:]] \
                                        <fortran functions> ] \
                                       [: <fortran files> ...]

2) To compile fortran files and build extension modules:

      f2py -c [<options>, <build_flib options>, <extra options>] <fortran files>

3) To generate signature files:

      f2py -h <filename.pyf> ...< same options as in (1) >

Description: This program generates a Python C/API file (<modulename>module.c)
             that contains wrappers for given fortran functions so that they
             can be called from Python. With the -c option the corresponding
             extension modules are built.

Options:

  --2d-numpy Use numpy.f2py tool with NumPy support. [DEFAULT]
  --2d-numeric Use f2py2e tool with Numeric support.
  --2d-numarray Use f2py2e tool with Numarray support.
  --g3-numpy Use 3rd generation f2py from the separate f2py package.
                   [NOT AVAILABLE YET]

  -h <filename> Write signatures of the fortran routines to file <filename>
                   and exit. You can then edit <filename> and use it instead
                   of <fortran files>. If <filename>==stdout then the
                   signatures are printed to stdout.
  <fortran functions> Names of fortran routines for which Python C/API
                   functions will be generated. Default is all that are found
                   in <fortran files>.
  <fortran files> Paths to fortran/signature files that will be scanned for
                   <fortran functions> in order to determine their signatures.
  skip: Ignore fortran functions that follow until `:'.
  only: Use only fortran functions that follow until `:'.
  : Get back to <fortran files> mode.

  -m <modulename> Name of the module; f2py generates a Python/C API
                   file <modulename>module.c or extension module <modulename>.
                   Default is 'untitled'.

  --[no-]lower Do [not] lower the cases in <fortran files>. By default,
                   --lower is assumed with -h key, and --no-lower without -h key.

  --build-dir <dirname> All f2py generated files are created in <dirname>.
                   Default is tempfile.mktemp().

  --overwrite-signature Overwrite existing signature file.

  --[no-]latex-doc Create (or not) <modulename>module.tex.
                   Default is --no-latex-doc.
  --short-latex Create 'incomplete' LaTeX document (without commands
                   \documentclass, \tableofco...

Read more...

Revision history for this message
Matthias Klose (doko) wrote :

fixed in karmic (1.3.0)

Changed in python-numpy (Ubuntu):
status: New → Fix Released
Revision history for this message
isabel puchoc (puchoc42) wrote :

hi I have a problem I installed f2py with sudo aptitude install f2py , but when i want to prove i have this problem

isabel@isabel-laptop:~$ f2py
Traceback (most recent call last):
  File "/usr/local/bin/f2py", line 3, in <module>
    import f2py2e
  File "/usr/local/lib/python2.6/dist-packages/f2py2e/__init__.py", line 10, in <module>
    import f2py2e
  File "/usr/local/lib/python2.6/dist-packages/f2py2e/f2py2e.py", line 26, in <module>
    import crackfortran
  File "/usr/local/lib/python2.6/dist-packages/f2py2e/crackfortran.py", line 1586
    as=b['args']
     ^
SyntaxError: invalid syntax

i have pyhton 2.6 on ubuntu 9.04, thank for your help

Revision history for this message
isabel puchoc (puchoc42) wrote :

i need to build flaplace but I can;t to install f2py , how can I do?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.