molodiuc / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

Cython installation problem solved - please adapt #252

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If relevant, please answer to the following questions:
1. What version of Python(x,y) have you installed?
2.6.6.0
2. Which components have you installed (Python(x,y) installer: component
page):
c. Have you selected manually plugins in the component list? What
plugins?
in addition I selected Cython which is the problem I want to report below.
3. Have you selected the option "Customize installation directories"?
b. No
5. Where did you install Python(x,y) itself?
a. default path
6. Have you installed Python(x,y):
    a. For "Current user only"
    b. For "All users"
Actually I don't know but it doesn't matter for the subject in question I 
suppose.
7. What is your operating system?
a. Windows XP
8. When you installed Python(x,y), were you logged in as :
b. an administrator of the machine
10. Regarding installed softwares on your machine, how did you clean your
machine before installing Python(x,y) (multiple answers are possible):
a. you didn't do anything, you installed Python(x,y) directly on your
machine without precaution

What is the expected output? What do you see instead?

I rather want to report a problem that is caused by your Cython installation. 
We finally solved that problem, and you may want to avoid this problem in other 
users, so please follow the instructions.

(This problem has predominantly discussed in the Cython user news group 
http://groups.google.com/group/cython-users/browse_thread/thread/f30f6a66281ba29
2 Thread: Cython compilation Problem "error: Unable to find vcvarsall.bat")

To avoid this problem please during Cython installation.
1. Put MinGW on the Windows PATH
2. Add a configuration file that makes MinGW the default compiler.
as described here 
(http://conference.scipy.org/proceedings/SciPy2009/paper_1/full_text.pdf)

Finally, tell Python to use MinGW as the default
compiler (otherwise it will try for Visual C). If
Python is installed to “c:\Python26”, create a file
named “c:\Python26\Lib\distutils\distutils.cfg”
containing:
[build]
compiler = mingw32

Thanks
R.

Original issue reported on code.google.com by Kamha...@googlemail.com on 1 Jun 2011 at 5:46

GoogleCodeExporter commented 9 years ago
Will look into it. We need to consider machines where VS is installed.

Original comment by grizzly.nyo on 19 Aug 2011 at 1:16

GoogleCodeExporter commented 9 years ago
The problem: Cython finds the Visual C++ compiler instead of MinGW.
The proposed solution: change the default compiler for the entire Python 
installation to MinGW, and change the users PATH. Is this a permanent change? 
Or only during installation?
If these are permanent changes, they will break other packages which expect the 
Visual C++ compiler, which is the default for Python on Windows. Using the 
--compiler option to setup.py would be better than changing distutils.cfg IMHO.

Original comment by koenvand...@gmail.com on 5 Sep 2011 at 12:53

GoogleCodeExporter commented 9 years ago
Let's keep Cython's defaults unmodified.

Original comment by grizzly.nyo on 12 Oct 2011 at 10:09

GoogleCodeExporter commented 9 years ago
See http://wiki.cython.org/InstallingOnWindows ... I just added a section at 
the start describing how to set the compiler when you call Cython. (I did not 
have to modify the PATH when I did this.) This can be done totally within an 
IPython---no command lines, no configuration files---which I think is better 
for users who are not experienced programmers.

That said, I find it hard to believe that it's completely impossible, during 
the installation process, to set a default compiler for Cython that's actually 
installed.

Original comment by steven.b...@gmail.com on 17 Jun 2012 at 2:25

GoogleCodeExporter commented 9 years ago
Is this why `pip install line_profiler` doesn't work?

I get "error: Unable to find vcvarsall.bat"

Original comment by omegat...@gmail.com on 8 May 2013 at 1:59

GoogleCodeExporter commented 9 years ago
Following these steps fixed it:

3) Add the path of the compiler to your PATH environment variable (eg: 
c:\mingw\bin should appear in the PATH)

4) Now open the prompt and check if the compiler is correctly installed (gcc 
--version should be properly working)

5) It is very useful to tell distutils to use mingw. To achieve this, create a 
file named distutils.cfg (if you already don't have it) in your 
\PythonXY\Lib\distutils and add to it the following lines:

[build]
compiler = mingw32

Dunno why it works fine by default on one machine's pythonxy but not the other.

Original comment by omegat...@gmail.com on 8 May 2013 at 2:05