Sorry for asking what may be a very simple (or even technically incorrect) question , but I am trying to get a little more information.
I was hoping that WinPython could possibly make my entry to using Cython a little easier. I have not had much luck with Cython to date, and I know that I am likely missing something simple. So I have downloaded WinPython to try some things out and see if I can get Cython running under a more controlled setting.
Does the distribution also contain all of the Python header files and code required by Cython for compilation of cPython functions into modules? And is there a specific approach that is recommended for using Cython from WinPython.
Also, when poking around in the python-2.7.3\Scripts folder, I see numerous "*.bat" files that I don't have in my normal Python distribution. Is there any information available regarding what these are used for?
Sorry for cluttering the list with such basic questions, but thanks in advance for any information that anyone can provide.
> Sorry for asking what may be a very simple (or even technically incorrect)
> question , but I am trying to get a little more information.
> I was hoping that WinPython could possibly make my entry to using Cython a
> little easier. I have not had much luck with Cython to date, and I know that
> I am likely missing something simple. So I have downloaded WinPython to try
> some things out and see if I can get Cython running under a more controlled
> setting.
> Does the distribution also contain all of the Python header files and code
> required by Cython for compilation of cPython functions into modules? And is
Yes for the 32-bit version of WinPython (MinGW32 with gcc is
included), and no for the 64-bit version (you will have to install
your own C compiler).
> there a specific approach that is recommended for using Cython from
> WinPython.
No, WinPython is really close to a standard Windows Python
installation. When running one of the launchers (.exe files at the
root directory), the environment is exactly the same as the one you
would have after installing Python with the official installer. So to
run scripts installed with WinPython (like Cython) from a command
window, you would have to run cmd.exe. But you can also run everything
from Spyder: you write your .pyx script and build it in a terminal
inside Spyder.
> Also, when poking around in the python-2.7.3\Scripts folder, I see numerous
> "*.bat" files that I don't have in my normal Python distribution. Is there
> any information available regarding what these are used for?
As I tried to explain in the readme.txt in that directory, these batch
scripts are indeed specific to WinPython and they are only there to
help the user eventually writing its own launchers. For example, the
script "scripts\spyder.bat" does (almost) exactly the same things as
the launcher "Spyder.exe". But none of this script is required for
using WinPython, these are extras.
> Sorry for cluttering the list with such basic questions, but thanks in
> advance for any information that anyone can provide.
> --
> You received this message because you are subscribed to the Google Groups
> "WinPython" group.
> To unsubscribe from this group, send email to
> winpython+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Thank you, Pierre. I again apologize for asking extremely simple questions.
My interest in your WinPython distributions stems from my lack of success using Cython in the past. I have always suspected that there is some sort of minor configuration issue occurring that is preventing me from making progress. Unfortunately I am still not having much success getting the basic Cython tutorial to work (a simple "Hello World!"; http://docs.cython.org/src/userguide/tutorial.html), even when using WinPython.
And I sincerely apologize if this question should be asked elsewhere, but this seemed like a reasonable place to start given the goals of WinPython.
1) I have installed WinPython in "C:\WinPython-32bit-2.7.3.0". This directory includes all of the links to Spyder, IPython, WPControlPanel, etc.
2) Using Spyder, I created the "helloworld.pyx" and "setup.py" files indicated in the Cython tutorial. These file sit in a directory called "C:\WinPython-32bit-2.7.3.0\python-2.7.3\myCython"
3) Still within Spyder, I used the "Tools" menu to open a command prompt (it opens to the locations where my .pyx and setup.py file are located).
4) I issue the command
"python setup.py build_ext --inplace" at the prompt (as listed in the tutorial) and then see the following output:
running build_ext cythoning hello.pyx to hello.c building 'hello' extension error: Unable to find vcvarsall.bat
I have searched my WinPython directory for the "vcvarsall.bat" file, and it doesn't exist.
On Tuesday, September 25, 2012 11:42:22 AM UTC-7, Pierre Raybaut wrote:
> 2012/9/25 Mark <markper...@gmail.com <javascript:>>: > > Sorry for asking what may be a very simple (or even technically > incorrect) > > question , but I am trying to get a little more information.
> > I was hoping that WinPython could possibly make my entry to using Cython > a > > little easier. I have not had much luck with Cython to date, and I know > that > > I am likely missing something simple. So I have downloaded WinPython to > try > > some things out and see if I can get Cython running under a more > controlled > > setting.
> > Does the distribution also contain all of the Python header files and > code > > required by Cython for compilation of cPython functions into modules? > And is
> Yes for the 32-bit version of WinPython (MinGW32 with gcc is > included), and no for the 64-bit version (you will have to install > your own C compiler).
> > there a specific approach that is recommended for using Cython from > > WinPython.
> No, WinPython is really close to a standard Windows Python > installation. When running one of the launchers (.exe files at the > root directory), the environment is exactly the same as the one you > would have after installing Python with the official installer. So to > run scripts installed with WinPython (like Cython) from a command > window, you would have to run cmd.exe. But you can also run everything > from Spyder: you write your .pyx script and build it in a terminal > inside Spyder.
> > Also, when poking around in the python-2.7.3\Scripts folder, I see > numerous > > "*.bat" files that I don't have in my normal Python distribution. Is > there > > any information available regarding what these are used for?
> As I tried to explain in the readme.txt in that directory, these batch > scripts are indeed specific to WinPython and they are only there to > help the user eventually writing its own launchers. For example, the > script "scripts\spyder.bat" does (almost) exactly the same things as > the launcher "Spyder.exe". But none of this script is required for > using WinPython, these are extras.
> > Sorry for cluttering the list with such basic questions, but thanks in > > advance for any information that anyone can provide.
> No, problem.
> -Pierre
> > -Mark
> > -- > > You received this message because you are subscribed to the Google > Groups > > "WinPython" group. > > To unsubscribe from this group, send email to > > winpython+...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out.
Thank you, Pierre. I again apologize for asking extremely simple questions.
My interest in your WinPython distributions stems from my lack of success using Cython in the past. I have always suspected that there is some sort of minor configuration issue occurring that is preventing me from making progress. Unfortunately I am still not having much success getting the basic Cython tutorial to work (a simple "Hello World!"; http://docs.cython.org/src/userguide/tutorial.html), even when using WinPython.
And I sincerely apologize if this question should be asked elsewhere, but this seemed like a reasonable place to start given the goals of WinPython.
1) I have installed WinPython in "C:\WinPython-32bit-2.7.3.0". This directory includes all of the links to Spyder, IPython, WPControlPanel, etc.
2) Using Spyder, I created the "helloworld.pyx" and "setup.py" files indicated in the Cython tutorial. These file sit in a directory called "C:\WinPython-32bit-2.7.3.0\python-2.7.3\myCython"
3) Still within Spyder, I used the "Tools" menu to open a command prompt (it opens to the locations where my .pyx and setup.py file are located).
4) I issue the command
"python setup.py build_ext --inplace" at the prompt (as listed in the tutorial) and then see the following output:
running build_ext cythoning hello.pyx to hello.c building 'hello' extension error: Unable to find vcvarsall.bat
I have searched my WinPython directory for the "vcvarsall.bat" file, and it doesn't exist.
On Tuesday, September 25, 2012 11:42:22 AM UTC-7, Pierre Raybaut wrote:
> 2012/9/25 Mark <markper...@gmail.com <javascript:>>: > > Sorry for asking what may be a very simple (or even technically > incorrect) > > question , but I am trying to get a little more information.
> > I was hoping that WinPython could possibly make my entry to using Cython > a > > little easier. I have not had much luck with Cython to date, and I know > that > > I am likely missing something simple. So I have downloaded WinPython to > try > > some things out and see if I can get Cython running under a more > controlled > > setting.
> > Does the distribution also contain all of the Python header files and > code > > required by Cython for compilation of cPython functions into modules? > And is
> Yes for the 32-bit version of WinPython (MinGW32 with gcc is > included), and no for the 64-bit version (you will have to install > your own C compiler).
> > there a specific approach that is recommended for using Cython from > > WinPython.
> No, WinPython is really close to a standard Windows Python > installation. When running one of the launchers (.exe files at the > root directory), the environment is exactly the same as the one you > would have after installing Python with the official installer. So to > run scripts installed with WinPython (like Cython) from a command > window, you would have to run cmd.exe. But you can also run everything > from Spyder: you write your .pyx script and build it in a terminal > inside Spyder.
> > Also, when poking around in the python-2.7.3\Scripts folder, I see > numerous > > "*.bat" files that I don't have in my normal Python distribution. Is > there > > any information available regarding what these are used for?
> As I tried to explain in the readme.txt in that directory, these batch > scripts are indeed specific to WinPython and they are only there to > help the user eventually writing its own launchers. For example, the > script "scripts\spyder.bat" does (almost) exactly the same things as > the launcher "Spyder.exe". But none of this script is required for > using WinPython, these are extras.
> > Sorry for cluttering the list with such basic questions, but thanks in > > advance for any information that anyone can provide.
> No, problem.
> -Pierre
> > -Mark
> > -- > > You received this message because you are subscribed to the Google > Groups > > "WinPython" group. > > To unsubscribe from this group, send email to > > winpython+...@googlegroups.com <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out.
> Thank you, Pierre. I again apologize for asking extremely simple questions.
> My interest in your WinPython distributions stems from my lack of success
> using Cython in the past. I have always suspected that there is some sort of
> minor configuration issue occurring that is preventing me from making
> progress. Unfortunately I am still not having much success getting the
> basic Cython tutorial to work (a simple "Hello World!";
> http://docs.cython.org/src/userguide/tutorial.html), even when using
> WinPython.
> And I sincerely apologize if this question should be asked elsewhere, but
> this seemed like a reasonable place to start given the goals of WinPython.
> 1) I have installed WinPython in "C:\WinPython-32bit-2.7.3.0". This
> directory includes all of the links to Spyder, IPython, WPControlPanel, etc.
Ok, so this is the 32-bit version of WinPython including a free C
compiler (MinGW32 with gcc).
> 2) Using Spyder, I created the "helloworld.pyx" and "setup.py" files
> indicated in the Cython tutorial. These file sit in a directory called
> "C:\WinPython-32bit-2.7.3.0\python-2.7.3\myCython"
Just a suggestion: avoid mixing installed libraries and your own.
Moving the 'myCython' folder to a 'C:\dev\myCython' folder would
probably be more cleaner.
> 3) Still within Spyder, I used the "Tools" menu to open a command prompt (it
> opens to the locations where my .pyx and setup.py file are located).
Ok.
> 4) I issue the command
> "python setup.py build_ext --inplace" at the prompt (as listed in the
> tutorial) and then see the following output:
> running build_ext
> cythoning hello.pyx to hello.c
> building 'hello' extension
> error: Unable to find vcvarsall.bat
> I have searched my WinPython directory for the "vcvarsall.bat" file, and it
> doesn't exist.
This is a classic error due to the fact that the default C compiler on
Windows for Python is Microsoft Visual C/C++ (that's what 'vc' stands
for in 'vcvarsall.bat'). So either you install the free version of
this compiler (Microsoft Visual C/C++ 2008 Express Edition -- why
2008? because Python 2.7 was built with this compiler version) or you
will have to tell Python to use MinGW32 instead of MSVC compiler with
the '-c' option as in the following command.
python setup.py build_ext -c mingw32 --inplace
That should work but it isn't with WinPython v2.7.3.0 32bit because I
have apparently forgot to include some essential files for MinGW32
(that's my fault: I did very limited testing of MinGW32 as I'm
replacing it with MSVC in all my projects due to an imminent migration
from 32-bit to 64-bit).
> On Tuesday, September 25, 2012 11:42:22 AM UTC-7, Pierre Raybaut wrote:
>> 2012/9/25 Mark <markper...@gmail.com>:
>> > Sorry for asking what may be a very simple (or even technically
>> > incorrect)
>> > question , but I am trying to get a little more information.
>> > I was hoping that WinPython could possibly make my entry to using Cython
>> > a
>> > little easier. I have not had much luck with Cython to date, and I know
>> > that
>> > I am likely missing something simple. So I have downloaded WinPython to
>> > try
>> > some things out and see if I can get Cython running under a more
>> > controlled
>> > setting.
>> > Does the distribution also contain all of the Python header files and
>> > code
>> > required by Cython for compilation of cPython functions into modules?
>> > And is
>> Yes for the 32-bit version of WinPython (MinGW32 with gcc is
>> included), and no for the 64-bit version (you will have to install
>> your own C compiler).
>> > there a specific approach that is recommended for using Cython from
>> > WinPython.
>> No, WinPython is really close to a standard Windows Python
>> installation. When running one of the launchers (.exe files at the
>> root directory), the environment is exactly the same as the one you
>> would have after installing Python with the official installer. So to
>> run scripts installed with WinPython (like Cython) from a command
>> window, you would have to run cmd.exe. But you can also run everything
>> from Spyder: you write your .pyx script and build it in a terminal
>> inside Spyder.
>> > Also, when poking around in the python-2.7.3\Scripts folder, I see
>> > numerous
>> > "*.bat" files that I don't have in my normal Python distribution. Is
>> > there
>> > any information available regarding what these are used for?
>> As I tried to explain in the readme.txt in that directory, these batch
>> scripts are indeed specific to WinPython and they are only there to
>> help the user eventually writing its own launchers. For example, the
>> script "scripts\spyder.bat" does (almost) exactly the same things as
>> the launcher "Spyder.exe". But none of this script is required for
>> using WinPython, these are extras.
>> > Sorry for cluttering the list with such basic questions, but thanks in
>> > advance for any information that anyone can provide.
>> No, problem.
>> -Pierre
>> > -Mark
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "WinPython" group.
>> > To unsubscribe from this group, send email to
>> > winpython+...@googlegroups.com.
>> > For more options, visit https://groups.google.com/groups/opt_out.
> --
> You received this message because you are subscribed to the Google Groups
> "WinPython" group.
> To unsubscribe from this group, send email to
> winpython+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Thanks Pierre: I look forward to seeing the next release. It will be
extremely to have something pre-configured that does not need to rely
on the microsoft compiler.
In the meantime, I did install the MS 2008 C++ compiler that you
suggested. Installation seems to be fine, but I am still getting
errors when trying to compile the 'hello world' example. Here's the
readout...I am just mentioning it in case it is indicative of some
other sort of problem that you might need to be aware of.
Thanks again, and I am definitely looking forward to the next release!
-Mark
C:\Marks\Python_code\Cython\hello>python setup.py build_ext --inplace
running build_ext
cythoning hello.pyx to hello.c
building 'hello' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo
/Ox /MD /W3 /GS- /DNDEBUG
-IC:\WinPython-32bit-2.7.3.0\python-2.7.3\include
-IC:\WinPython-32bit-2.7.3.0\python-2.7.3\PC /Tchello.c
/Fobuild\temp.win32-2.7\Release\hello.obj
hello.c
c:\winpython-32bit-2.7.3.0\python-2.7.3\include\pyconfig.h(227) :
fatal error C1083: Cannot open include file: 'basetsd.h': No such file
or directory
error: command '"C:\Program Files\Microsoft Visual Studio
9.0\VC\BIN\cl.exe"' failed with exit status 2
<pierre.rayb...@gmail.com> wrote:
> 2012/9/28 Mark <markperrymil...@gmail.com>:
>> Thank you, Pierre. I again apologize for asking extremely simple questions.
>> My interest in your WinPython distributions stems from my lack of success
>> using Cython in the past. I have always suspected that there is some sort of
>> minor configuration issue occurring that is preventing me from making
>> progress. Unfortunately I am still not having much success getting the
>> basic Cython tutorial to work (a simple "Hello World!";
>> http://docs.cython.org/src/userguide/tutorial.html), even when using
>> WinPython.
>> And I sincerely apologize if this question should be asked elsewhere, but
>> this seemed like a reasonable place to start given the goals of WinPython.
>> 1) I have installed WinPython in "C:\WinPython-32bit-2.7.3.0". This
>> directory includes all of the links to Spyder, IPython, WPControlPanel, etc.
> Ok, so this is the 32-bit version of WinPython including a free C
> compiler (MinGW32 with gcc).
>> 2) Using Spyder, I created the "helloworld.pyx" and "setup.py" files
>> indicated in the Cython tutorial. These file sit in a directory called
>> "C:\WinPython-32bit-2.7.3.0\python-2.7.3\myCython"
> Just a suggestion: avoid mixing installed libraries and your own.
> Moving the 'myCython' folder to a 'C:\dev\myCython' folder would
> probably be more cleaner.
>> 3) Still within Spyder, I used the "Tools" menu to open a command prompt (it
>> opens to the locations where my .pyx and setup.py file are located).
> Ok.
>> 4) I issue the command
>> "python setup.py build_ext --inplace" at the prompt (as listed in the
>> tutorial) and then see the following output:
>> running build_ext
>> cythoning hello.pyx to hello.c
>> building 'hello' extension
>> error: Unable to find vcvarsall.bat
>> I have searched my WinPython directory for the "vcvarsall.bat" file, and it
>> doesn't exist.
> This is a classic error due to the fact that the default C compiler on
> Windows for Python is Microsoft Visual C/C++ (that's what 'vc' stands
> for in 'vcvarsall.bat'). So either you install the free version of
> this compiler (Microsoft Visual C/C++ 2008 Express Edition -- why
> 2008? because Python 2.7 was built with this compiler version) or you
> will have to tell Python to use MinGW32 instead of MSVC compiler with
> the '-c' option as in the following command.
> python setup.py build_ext -c mingw32 --inplace
> That should work but it isn't with WinPython v2.7.3.0 32bit because I
> have apparently forgot to include some essential files for MinGW32
> (that's my fault: I did very limited testing of MinGW32 as I'm
> replacing it with MSVC in all my projects due to an imminent migration
> from 32-bit to 64-bit).
> In the meantime, you may install Microsoft Visual C/C++ 2008 Express
> Edition, and everything will work as expected.
> -Pierre
>> Does anyone have any suggestions?
>> Thanks,
>> -Mark
>> On Tuesday, September 25, 2012 11:42:22 AM UTC-7, Pierre Raybaut wrote:
>>> 2012/9/25 Mark <markper...@gmail.com>:
>>> > Sorry for asking what may be a very simple (or even technically
>>> > incorrect)
>>> > question , but I am trying to get a little more information.
>>> > I was hoping that WinPython could possibly make my entry to using Cython
>>> > a
>>> > little easier. I have not had much luck with Cython to date, and I know
>>> > that
>>> > I am likely missing something simple. So I have downloaded WinPython to
>>> > try
>>> > some things out and see if I can get Cython running under a more
>>> > controlled
>>> > setting.
>>> > Does the distribution also contain all of the Python header files and
>>> > code
>>> > required by Cython for compilation of cPython functions into modules?
>>> > And is
>>> Yes for the 32-bit version of WinPython (MinGW32 with gcc is
>>> included), and no for the 64-bit version (you will have to install
>>> your own C compiler).
>>> > there a specific approach that is recommended for using Cython from
>>> > WinPython.
>>> No, WinPython is really close to a standard Windows Python
>>> installation. When running one of the launchers (.exe files at the
>>> root directory), the environment is exactly the same as the one you
>>> would have after installing Python with the official installer. So to
>>> run scripts installed with WinPython (like Cython) from a command
>>> window, you would have to run cmd.exe. But you can also run everything
>>> from Spyder: you write your .pyx script and build it in a terminal
>>> inside Spyder.
>>> > Also, when poking around in the python-2.7.3\Scripts folder, I see
>>> > numerous
>>> > "*.bat" files that I don't have in my normal Python distribution. Is
>>> > there
>>> > any information available regarding what these are used for?
>>> As I tried to explain in the readme.txt in that directory, these batch
>>> scripts are indeed specific to WinPython and they are only there to
>>> help the user eventually writing its own launchers. For example, the
>>> script "scripts\spyder.bat" does (almost) exactly the same things as
>>> the launcher "Spyder.exe". But none of this script is required for
>>> using WinPython, these are extras.
>>> > Sorry for cluttering the list with such basic questions, but thanks in
>>> > advance for any information that anyone can provide.
>>> No, problem.
>>> -Pierre
>>> > -Mark
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups
>>> > "WinPython" group.
>>> > To unsubscribe from this group, send email to
>>> > winpython+...@googlegroups.com.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>> --
>> You received this message because you are subscribed to the Google Groups
>> "WinPython" group.
>> To unsubscribe from this group, send email to
>> winpython+unsubscribe@googlegroups.com.
>> For more options, visit https://groups.google.com/groups/opt_out.
> --
> You received this message because you are subscribed to the Google Groups "WinPython" group.
> To unsubscribe from this group, send email to winpython+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
The newest release seems to be working for me now. Thanks for working on it, Pierre. Initially, after installing it, I was still getting some errors when compiling an extension with Cython:
cc1.exe: error: unrecognized command line option '-mno-cygwin' error: command 'gcc' failed with exit status 1
I fiddled with this for a while, and was finally able to get everything to work after editing the file "cygwincompiler.py" in \Lib\distutils from the Python distribution. The changes were as follows (original commented-out code from line 322 followed by the edited version:
I ran into this same issue today and after 2 hours gave up trying to fix it for the day. Your fix worked for me as well. Thank you for the tip.
I have also read else where that instead of having to type -c mingw32 when you compile, you can add a distutils.cfg file to your distutils folder in Python2.7.3\Lib with the contents:
[build]
compiler=mingw32
This worked from a command prompt inside Spyder for me (other than then giving the error you seem to have now resolved), but when I would try and have cython compile from source instead of using a setup.py file using the:
On Tuesday, October 16, 2012 5:59:46 PM UTC-4, Mark wrote:
> The newest release seems to be working for me now. Thanks for working on > it, Pierre. Initially, after installing it, I was still getting some errors > when compiling an extension with Cython:
> cc1.exe: error: unrecognized command line option '-mno-cygwin' > error: command 'gcc' failed with exit status 1
> I fiddled with this for a while, and was finally able to get everything to > work after editing the file "cygwincompiler.py" in \Lib\distutils from the > Python distribution. The changes were as follows (original commented-out > code from line 322 followed by the edited version: