Error when trying to build minimal cython file with python 3.3 (Anaconda) under windows 7

3 views
Skip to first unread message

pierre.a...@gmail.com

unread,
Jun 18, 2014, 7:05:36 PM6/18/14
to anac...@continuum.io

Hello,

When I try to build a minimal Cython file test.pyx with Python 3.3 (Anaconda 3) under windows 7, I obtain a strange error:

C:\Users\myname\Test_cython>python setup.py build
running build
running build_ext
error: [WinError 2] The system cannot find the file specified

Of course test.pyx is in the working directory. It works fine under windows with Python 2.7 (Anaconda) and under Linux with Python 2 and 3.

What could be the problem here with Python 3.3 (Anaconda 3)?

Thanks

The file setup.py:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
    name = 'test',
    cmdclass = {"build_ext": build_ext},
    ext_modules = [Extension('test', ['test.pyx'])]
    )

Aaron Meurer

unread,
Jun 18, 2014, 7:12:55 PM6/18/14
to anaconda
Does it work if you restart Windows? That has helped with this error
in the past.

Aaron Meurer
> --
> Anaconda Community Support Group Brought to you by Continuum Analytics
> ---
> You received this message because you are subscribed to the Google Groups
> "Anaconda - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to anaconda+u...@continuum.io.
> To post to this group, send email to anac...@continuum.io.
> Visit this group at http://groups.google.com/a/continuum.io/group/anaconda/.

Pierre Augier

unread,
Jun 20, 2014, 10:03:39 AM6/20/14
to anac...@continuum.io
No, it does not work even after a restart of Windows. Thanks anyway.

I think I found the problem.
If I change the line 404 of the file cygwinccompiler.py of the package disutils
    out_string = check_output(['gcc', '-dumpmachine'])
as
    out_string = check_output(['gcc', '-dumpmachine'], shell=True)
it compiles normally.

Here, check_output is subprocess.check_output. It seems to me that this is a real bug...




You received this message because you are subscribed to a topic in the Google Groups "Anaconda - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/anaconda/6_reeaIjx5c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to anaconda+u...@continuum.io.

Aaron Meurer

unread,
Jun 20, 2014, 3:48:59 PM6/20/14
to anaconda
Ah yes, I forgot that that was also a solution to the problem.

I guess if you want you can report it at http://bugs.python.org/. It
seems to be the same way in the hg Python
(http://hg.python.org/cpython/file/b7f2d30e93a8/Lib/distutils/cygwinccompiler.py#l404).
I didn't find a bug report for it already (although I did see several
reports for the cygwinccompiler file, so I may have missed it).

I don't fully understand why shell=True is needed. I had thought it
was just that some environment variables weren't synchronized for a
subprocess vs. a shell (hence why restarting fixed it).

Aaron Meurer

sloboda...@gmail.com

unread,
Jun 25, 2014, 11:49:09 AM6/25/14
to anac...@continuum.io, pierre...@ens-lyon.org
Hi,

I'm having similar problems with Python 2.7, being unable to install any of the pypi packages with Conda on Windows 7 (x64) (with "conda pipbuild package"). I have tried the proposed solution, but in the cygwinccompiler.py, there is no check_output() method, but rather an os.popen() call. I tried adding the shell=True argument, but am still getting the same error. Has anyone encountered this problem while using Python 2.7?

Best,
Slobodan
Reply all
Reply to author
Forward
0 new messages