Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install cythonize failure (Trac #1878) #2397

Closed
scipy-gitbot opened this issue Apr 25, 2013 · 6 comments · Fixed by #2449
Closed

pip install cythonize failure (Trac #1878) #2397

scipy-gitbot opened this issue Apr 25, 2013 · 6 comments · Fixed by #2449
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac

Comments

@scipy-gitbot
Copy link

Original ticket http://projects.scipy.org/scipy/ticket/1878 on 2013-03-28 by trac user akrimkevich, assigned to @cournape.

When installing scipy using 'pip install -e git+git://github.com/scipy/scipy.git#egg=scipy-dev', the cythonize.py script fails because it attempts to execute the 'cython' program, which it appears is not a byproduct of the install of cython 0.18. Please see attached output.
[[BR]][[BR]]
$ python --version[[BR]]
Python 2.7.3[[BR]][[BR]]
$ python -c "import Cython; print Cython.version"[[BR]]
0.18[[BR]][[BR]]
$ uname -prsv[[BR]]
Darwin 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 i386[[BR]]

An executable cython.py is, however, placed in site-packages. Wrapping it in a script like the following allowed a successful install.

/bin/bash

python /usr/local/lib/python2.7/site-packages/cython.py $@

@scipy-gitbot
Copy link
Author

Attachment added by trac user akrimkevich on 2013-03-28: output.txt

@scipy-gitbot
Copy link
Author

Title changed from scipy to pip install cythonize failure by @pv on 2013-03-28

@scipy-gitbot
Copy link
Author

@rgommers wrote on 2013-04-01

How did you install Cython? I haven't seen this on Linux yet.

On Windows this does happen, we probably need something like this (snippet copied from scikit-image):

            try:
                subprocess.call(['cython', '-o', c_file, pyxfile])
            except WindowsError:
                # On Windows cython.exe may be missing if Cython was installed
                # via distutils. Run the cython.py script instead.
                subprocess.call(
                    [sys.executable,
                     os.path.join(os.path.dirname(sys.executable),
                                  'Scripts', 'cython.py'),
                     '-o', c_file, pyxfile],
                    shell=True)

@scipy-gitbot
Copy link
Author

trac user akrimkevich wrote on 2013-04-03

I used 'pip install cython'. Both python and pip were obtained from homebrew.

Replying to [comment:2 rgommers]:

How did you install Cython? I haven't seen this on Linux yet.

On Windows this does happen, we probably need something like this (snippet copied from scikit-image):
{{{
try:
subprocess.call(['cython', '-o', c_file, pyxfile])
except WindowsError:
# On Windows cython.exe may be missing if Cython was installed
# via distutils. Run the cython.py script instead.
subprocess.call(
[sys.executable,
os.path.join(os.path.dirname(sys.executable),
'Scripts', 'cython.py'),
'-o', c_file, pyxfile],
shell=True)
}}}

@scipy-gitbot
Copy link
Author

@rgommers wrote on 2013-04-03

OK, Cython has this in its setup.py:

if 'setuptools' in sys.modules:
    setuptools_extra_args['zip_safe'] = False
    setuptools_extra_args['entry_points'] = {
        'console_scripts': [
            'cython = Cython.Compiler.Main:setuptools_main',
        ]
    }
    scripts = []
else:
    if os.name == "posix":
        scripts = ["bin/cython"]
    else:
        scripts = ["cython.py"]

Sigh. With pip it should install the cython executable though, not sure why that didn't happen for you.

@rgommers
Copy link
Member

rgommers commented May 5, 2013

Probably fixed by gh-2449.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build issues Issues with building from source, including different choices of architecture, compilers and OS defect A clear bug or issue that prevents SciPy from being installed or used as expected Migrated from Trac
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants