f2py error - windows xp (F2PY-2.43.239_1806)

M

M. Faust

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
 
B

Berthold Höllmann

M. Faust said:
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
 
M

M. Faust

M. Faust said:
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
 
B

Berthold Höllmann

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

M. Faust

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
 
R

Robert Kern

M. Faust said:
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
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top