f2py error - windows xp (F2PY-2.43.239_1806)

Discussion in 'Python' started by M. Faust, Sep 25, 2004.

  1. M. Faust

    M. Faust Guest

    Hi,

    after having installed F2PY-2.43.239_1806 I get the following error when
    trying to run the hello.f example from the /docs directory:

    f2py.py --fcompiler=compaqv -c -m hello hello.f
    numpy_info:
    FOUND:
    define_macros = [('NUMERIC_VERSION', '"\\"23.1\\""')]
    include_dirs = ['D:\\Python23\\include']

    running build
    running config_fc
    running build_src
    building extension "hello" sources
    f2py:> d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\hellomodule.c
    creating d:\dokume~1\faust\lokale~1\temp\tmpypqgoi
    creating d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src
    Reading fortran codes...
    Reading file 'hello.f'
    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" to file
    "d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src/hellomodule.c"
    adding
    'd:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c' to sources.
    adding 'd:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src' to include_dirs.
    copying D:\Python23\lib\site-packages\f2py2e\src\fortranobject.c ->
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src
    copying D:\Python23\lib\site-packages\f2py2e\src\fortranobject.h ->
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src
    running build_ext
    No module named msvccompiler in scipy_distutils, trying from distutils..
    customize MSVCCompiler
    customize MSVCCompiler using build_ext
    0
    customize CompaqVisualFCompiler
    customize CompaqVisualFCompiler using build_ext
    building 'hello' extension
    compling C sources
    D:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD
    /W3 /GX /DNDEBUG -ID:\Python23\include -Id:\dokume~1\faust\l
    okale~1\temp\tmpypqgoi\src -ID:\Python23\include -ID:\Python23\PC
    /Tcd:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\hellomodule.c /Fo
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\hellomodule.obj
    D:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD
    /W3 /GX /DNDEBUG -ID:\Python23\include -Id:\dokume~1\faust\l
    okale~1\temp\tmpypqgoi\src -ID:\Python23\include -ID:\Python23\PC
    /Tcd:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c /
    Fod:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.obj
    fortranobject.c
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    error: Command ""D:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe"
    /c /nologo /Ox /MD /W3 /GX /DNDEBUG -ID:\Python23\include -Id
    :\dokume~1\faust\lokale~1\temp\tmpypqgoi\src -ID:\Python23\include
    -ID:\Python23\PC /Tcd:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src
    \fortranobject.c
    /Fod:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fortranobject.obj"
    failed with exit status 2

    I'm on Windows XP with Python 2.3.4. Has anybody an idea what's going
    wrong? Thanks in advance!

    Markus

    mailto: Markus.Faust at t-online.de
    M. Faust, Sep 25, 2004
    #1
    1. Advertising

  2. "M. Faust" <> writes:

    > Hi,
    >
    > after having installed F2PY-2.43.239_1806 I get the following error
    > when trying to run the hello.f example from the /docs directory:
    >
    > f2py.py --fcompiler=compaqv -c -m hello hello.f

    ....
    > error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    ....

    > I'm on Windows XP with Python 2.3.4. Has anybody an idea what's going
    > wrong? Thanks in advance!


    It seems the latest f2py versions need NumPy 23.3 which íntroduces
    'weakreflist' in the 'PyArrayObject' struct.

    Regards
    Berthold

    --
    / http://starship.python.net/crew/bhoel/
    Berthold Höllmann, Sep 25, 2004
    #2
    1. Advertising

  3. M. Faust

    M. Faust Guest

    I got the same error with NumPy 23.3.

    Markus
    M. Faust, Sep 25, 2004
    #3
  4. M. Faust

    M. Faust Guest

    M. Faust wrote:
    >
    > I got the same error with NumPy 23.3.
    >
    > Markus

    numpy_info:
    FOUND:
    define_macros = [('NUMERIC_VERSION', '"\\"23.3\\""')]
    include_dirs = ['D:\\Python23\\include']

    running build
    running config_fc
    running build_src
    building extension "hello" sources
    f2py:> d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\hellomodule.c
    creating d:\dokume~1\faust\lokale~1\temp\tmp57wwzd
    creating d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src
    Reading fortran codes...
    Reading file 'hello.f'
    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" to file
    "d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src/hellomodule.c"
    adding
    'd:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c' to sources.
    adding 'd:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src' to include_dirs.
    copying D:\Python23\lib\site-packages\f2py2e\src\fortranobject.c ->
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src
    copying D:\Python23\lib\site-packages\f2py2e\src\fortranobject.h ->
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src
    running build_ext
    No module named msvccompiler in scipy_distutils, trying from distutils..
    customize MSVCCompiler
    customize MSVCCompiler using build_ext
    0
    customize CompaqVisualFCompiler
    customize CompaqVisualFCompiler using build_ext
    building 'hello' extension
    compling C sources
    D:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD
    /W3 /GX /DNDEBUG -ID:\Python23\include -Id:\dokume~1\faust\l
    okale~1\temp\tmp57wwzd\src -ID:\Python23\include -ID:\Python23\PC
    /Tcd:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c /
    Fod:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.obj
    fortranobject.c
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.c(576) :
    error C2039: 'weakreflist' : is not a member of 'PyArrayObject'

    D:\Python23\include\Numeric/arrayobject.h(49) : see declaration
    of 'PyArrayObject'
    error: Command ""D:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe"
    /c /nologo /Ox /MD /W3 /GX /DNDEBUG -ID:\Python23\include -Id
    :\dokume~1\faust\lokale~1\temp\tmp57wwzd\src -ID:\Python23\include
    -ID:\Python23\PC /Tcd:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src
    \fortranobject.c
    /Fod:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fortranobject.obj"
    failed with exit status 2
    M. Faust, Sep 25, 2004
    #4
  5. "M. Faust" <> writes:

    > M. Faust wrote:
    >> I got the same error with NumPy 23.3.
    >> Markus


    Try to find your "Numeric/arrayobject.h". Mine has

    typedef struct {
    PyObject_HEAD
    char *data;
    int nd;
    int *dimensions, *strides;
    PyObject *base;
    PyArray_Descr *descr;
    int flags;
    PyObject *weakreflist;
    } PyArrayObject;

    and is from Numeric 23.3. In one of my installations updating to
    Numeric to 23.3 solved a similar error.

    Regards
    Berthold

    --
    / http://starship.python.net/crew/bhoel/
    Berthold Höllmann, Sep 26, 2004
    #5
  6. M. Faust

    M. Faust Guest

    Thanks, Bethold for a good hint ...

    I had in "Numeric/arrayobject.h"

    typedef struct {
    PyObject_HEAD
    char *data;
    int nd;
    int *dimensions, *strides;
    PyObject *base;
    PyArray_Descr *descr;
    int flags;
    } PyArrayObject;

    After adding

    PyObject *weakreflist;

    I could generate a hello.pyd. Python really is an incredibly versatile
    and powerful tool.

    Markus

    >
    > Try to find your "Numeric/arrayobject.h". Mine has
    >
    > typedef struct {
    > PyObject_HEAD
    > char *data;
    > int nd;
    > int *dimensions, *strides;
    > PyObject *base;
    > PyArray_Descr *descr;
    > int flags;
    > PyObject *weakreflist;
    > } PyArrayObject;
    >
    > and is from Numeric 23.3. In one of my installations updating to
    > Numeric to 23.3 solved a similar error.
    >
    > Regards
    > Berthold
    >
    M. Faust, Sep 27, 2004
    #6
  7. M. Faust

    Robert Kern Guest

    M. Faust wrote:
    > Thanks, Bethold for a good hint ...
    >
    > I had in "Numeric/arrayobject.h"
    >
    > typedef struct {
    > PyObject_HEAD
    > char *data;
    > int nd;
    > int *dimensions, *strides;
    > PyObject *base;
    > PyArray_Descr *descr;
    > int flags;
    > } PyArrayObject;
    >
    > After adding
    >
    > PyObject *weakreflist;
    >
    > I could generate a hello.pyd. Python really is an incredibly versatile
    > and powerful tool.


    Don't do that. You are looking at an old version of
    Numeric/arrayobject.h . Delete that directory and everything else
    Numeric and re-install Numeric 23.3 . Check it again. It should have the
    appropriate members, then.

    --
    Robert Kern


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
    Robert Kern, Sep 28, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sile
    Replies:
    5
    Views:
    679
  2. Sile
    Replies:
    6
    Views:
    433
  3. Flavio

    f2py on windows tutorials

    Flavio, Sep 23, 2006, in forum: Python
    Replies:
    12
    Views:
    1,164
    Robert Kern
    Sep 27, 2006
  4. Guest

    Re: [f2py] f2py problem

    Guest, May 15, 2007, in forum: Python
    Replies:
    0
    Views:
    575
    Guest
    May 15, 2007
  5. Blubaugh, David A.

    F2PY ?? Has anyone worked with the F2PY generator?

    Blubaugh, David A., Sep 8, 2008, in forum: Python
    Replies:
    0
    Views:
    255
    Blubaugh, David A.
    Sep 8, 2008
Loading...

Share This Page