On 2 September 2012 17:23, Virgil Stokes
<vs@it.uu.se> wrote:
I have only recently
joined this list --- hopefully my first mail to this list is
acceptable.
First, is it possible to place comments in the
distutils.cfg file? If yes, then how?
I don't know. There isn't much documentation for these things. Have you tried just using a '#' symbol like in python code?
Second, I have been unable to install yappi (included in
the PyPI list) on my Windows 7 (64-bit) platform with Python 2.7
(32-bit) and would greatly appreciate help on this installation.
Note, I have installed many other
PyPI packages on this
same system with no problems where I have cygwin, minGW (32-bit)
and minGW (64-bit) gcc and g++ compilers installed and working
properly. I have installed
yappi on my Windows Vista
(32-bit) platform with Python 2.7 and there were no problems. I
have also studied the information posted by Greg Ward at
http://docs.python.org/install/index.html.
Here are some of the results of my attempts to install
yappi
on the Windows 7 system.
I looked at what compilers are available for building from my
setup.py
file:
c:\Software\Python\yappi\yappi-0.62>python setup.py
build --help-compiler
List of available compilers:
--compiler=bcpp Borland C++ Compiler
--compiler=cygwin Cygwin port of GNU C Compiler
for Win32
--compiler=emx EMX port of GNU C Compiler for
OS/2
--compiler=mingw32 Mingw32 port of GNU C Compiler
for Win32
--compiler=msvc Microsoft Visual C++
--compiler=unix standard UNIX-style compiler
I then tried the following:
c:\Software\Python\yappi\yappi-0.62>python setup.py
build --compiler=cygwin
running build
running build_py
running build_ext
building '_yappi' extension
gcc -mcygwin -mdll -O -Wall -IC:\Python27\include
-IC:\Python27\PC -c _yappi.c -o
build\temp.win32-2.7\Release\_yappi.o
error: command 'gcc' failed: No such file or
directory
Maybe I'm missing something but are you running this from within cygwin or just from a normal cmd.exe window? It looks as if you're trying to use the cygwin compiler from outside of cygwin.
I then tried to be more specific,
c:\Software\Python\yappi\yappi-0.62>python setup.py
build
--compiler=c:\cygwin\bin\gcc.exe
running build
running build_py
running build_ext
building '_yappi' extension
error: don't don't know how to compile C/C++ code
on platform 'nt' with 'c:\cygwin\bin\gcc.exe' compiler
It says platform 'nt' maening that you are not in cygwin. You should be using the mingw compiler to compile outside of cygwin or the cygwin compiler compiler to compile inside cygwin. When you installed cygwin it should have given you an icon that you can click to open the cygwin shell. This cygwin shell looks like the ordinary cmd.exe window but it runs a bash shell and the programs that you run will be run inside cygwin.
I also tried many other possible (at least IMHO) solutions ---
these also
failed. For example,
c:\Software\Python\yappi\yappi-0.62>python setup.py
build --compiler=msvc
running build
running build_py
running build_ext
building '_yappi' extension
error: Unable to find vcvarsall.bat
I think this error comes from using a version of msvc that is too old for the python version that you are trying to install with. You need to have the version that matches your python version. See here:
I then modified the c:\python27\Lib\distutils\distutils.cfg
file and set
different compilers in it --- these also failed.
The bottom line --- all my trials (attempts) failed for one reason
or another.
Any suggestions as to how to proceed? I will be glad to provide
any additional
information on my trials.
There are three possible ways to fix this:
1) Get the right version of msvc (see link above)
2) Use --compiler=mingw in the normal cmd.exe window
3) Use --compiler=cygwin from inside the cygwin environment
Oscar