By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,130 Members | 2,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,130 IT Pros & Developers. It's quick & easy.

f2py error - windows xp (F2PY-2.43.239_1806)

P: n/a
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\hell omodule.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\for tranobject.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\he llomodule.c /Fo
d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\hell omodule.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\fo rtranobject.c /
Fod:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fo rtranobject.obj
fortranobject.c
d:\dokume~1\faust\lokale~1\temp\tmpypqgoi\src\fort ranobject.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\fort ranobject.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\fort ranobject.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\fort ranobject.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\fo rtranobject.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
Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"M. Faust" <ma*******@gmx.de> 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

--
bh***@web.de / http://starship.python.net/crew/bhoel/
Jul 18 '05 #2

P: n/a

I got the same error with NumPy 23.3.

Markus
Jul 18 '05 #3

P: n/a
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\hell omodule.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\for tranobject.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\fo rtranobject.c /
Fod:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fo rtranobject.obj
fortranobject.c
d:\dokume~1\faust\lokale~1\temp\tmp57wwzd\src\fort ranobject.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\fort ranobject.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\fort ranobject.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\fort ranobject.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\fo rtranobject.obj"
failed with exit status 2

Jul 18 '05 #4

P: n/a
"M. Faust" <ma*******@gmx.de> 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

--
bh***@web.de / http://starship.python.net/crew/bhoel/
Jul 18 '05 #5

P: n/a
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

Jul 18 '05 #6

P: n/a
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
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.