Problem building Python extension

M

martijnsteenwijk

Hi all,

I'm trying to build my first python extensionon a win32 system. I
followed the description in http://starship.python.net/crew/mwh/toext/your-first-extension.html,
but after running

C:\Python26\python first-setup.py build_ext -i

nothing seems to happen and no file first.pyd is produced.

The result from the cmd is the following:
running build_ext
building `first` extension
error: None

Does anyone have an idea what's going wrong?

Thanks for replies in advance,
Martijn
 
D

David Cournapeau

Hi all,

I'm trying to build my first python extensionon a win32 system. I
followed the description in http://starship.python.net/crew/mwh/toext/your-first-extension.html,
but after running

C:\Python26\python first-setup.py build_ext -i

nothing seems to happen and no file first.pyd is produced.

The result from the cmd is the following:
running build_ext
building `first` extension
error: None

It is a bug in distutils - you reminded me that I did not report it :)
.. IIRC, it is caused by the lack of a recognized installation VS 2008.
You should either install VS 2008 (the express vesion is free) or make
sure your VS 2008 is correctly installed.

Building python 2.6 extensions with mingw is possible as well, but I
think you need to build your own mingw (because python 2.6 requires
msvcr90.dll) - maybe recent mingw have msvcrt90.dll included.

cheers,

David
 
M

martijnsteenwijk

It is a bug in distutils - you reminded me that I did not report it :)
. IIRC, it is caused by the lack of a recognized installation VS 2008.
You should either install VS 2008 (the express vesion is free) or make
sure your VS 2008 is correctly installed.

Building python 2.6 extensions with mingw is possible as well, but I
think you need to build your own mingw (because python 2.6 requires
msvcr90.dll) - maybe recent mingw have msvcrt90.dll included.

cheers,

David

Thanks a lot for your reply. I downloaded & installed Visual C# 2008
express, but unfortunately this doesn't change anything in running the
setup file. Unfortunately, still no pyd file is produced...

Did I something wrong?
 
D

David Cournapeau

Thanks a lot for your reply. I downloaded & installed Visual C# 2008
express, but unfortunately this doesn't change anything in running the
setup file. Unfortunately, still no pyd file is produced...

I am not 100 % confident, but I think the problem is that for Visual
Studio express, you need to build the extension in a Visual Studio
shell (in the VS 2008 express menu). If that still does not work, I
will check on a windows VM (I need to do the bug report anyway).

cheers,

David
 
G

Giampaolo Rodola'

It is a bug in distutils - you reminded me that I did not report it :)
. IIRC, it is caused by the lack of a recognized installation VS 2008.
You should either install VS 2008 (the express vesion is free) or make
sure your VS 2008 is correctly installed.

Building python 2.6 extensions with mingw is possible as well, but I
think you need to build your own mingw (because python 2.6 requires
msvcr90.dll) - maybe recent mingw have msvcrt90.dll included.

cheers,

David

I already reported that:
http://bugs.python.org/issue4931


--- Giampaolo
http://code.google.com/p/pyftpdlib
 
M

martijnsteenwijk

Yeah, you installed the C# environment. Python is written in C, so you
have to get Visual Studio C++ 2008. However a recent version of MinGW32
is sufficient to build most extensions.

Christian

Hi Christian,

Thanks for your reply. In mean time, I discovered the C++ thing
already ;-).
Now I installed MinGW, but still the same happens. If I run the setup
file, the same output comes on the command line and no pyd file is
created... GRRR

Any suggestions?

Martijn
 
M

martijnsteenwijk

Hi Christian,

Thanks for your reply. In mean time, I discovered the C++ thing
already ;-).
Now I installed MinGW, but still the same happens. If I run the setup
file, the same output comes on the command line and no pyd file is
created... GRRR

Any suggestions?

Martijn

Hmmm, problem fixed :)
Downloaded the C++ compiler, runned the Visual Studio 2008 command
prompt and it works!
 
J

John Machin

Hi Christian,

Thanks for your reply. In mean time, I discovered the C++ thing
already ;-).
Now I installed MinGW, but still the same happens. If I run the setup
file, the same output comes on the command line and no pyd file is
created... GRRR

Any suggestions?

AFAIK it will attempt to use a compiler other than the one that Python
was compiled with only if specifically directed to e.g. with --
compiler=mingw32 in the command line when running setup.py.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top