Pandas: cython not found when building from source

Created on 6 Jun 2013  路  9Comments  路  Source: pandas-dev/pandas

This is when running on current master. Might there be some other prereqs missing? Thanks

$ cython --version
Cython version 0.17.4
$ python setup.py build
running build
running build_py
copying pandas/version.py -> build/lib.linux-x86_64-2.7/pandas
running build_ext
Traceback (most recent call last):
  File "setup.py", line 516, in <module>
    **setuptools_kwargs)
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "setup.py", line 328, in build_extensions
    self.check_cython_extensions(self.extensions)
  File "setup.py", line 325, in check_cython_extensions
    """ % src)
Exception: Cython-generated file 'pandas/parser.c' not found.
                Cython is required to compile pandas from a development branch.
                Please install Cython or download a release package of pandas.

Most helpful comment

@cpcloud

$ ci/print_versions.py 

INSTALLED VERSIONS
------------------
Python: 2.7.4.final.0
OS: Linux 3.8.0-23-generic #34-Ubuntu SMP Wed May 29 20:22:58 UTC 2013 x86_64
LC_ALL: None
LANG: en_US.UTF-8

Cython: Not installed
Numpy: 1.7.1
Scipy: 0.12.0
...

It is a Virtualenv, and it was not seeing the "global" cython.

I run pip install cython, and that corrected it.

Thank you for the pointers.

All 9 comments

try

python setup.py build_ext --inplace

@jreback I did already:

$ python setup.py build_ext --inplace 
running build_ext
Traceback (most recent call last):
  File "setup.py", line 516, in <module>
    **setuptools_kwargs)
  File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "setup.py", line 328, in build_extensions
    self.check_cython_extensions(self.extensions)
  File "setup.py", line 325, in check_cython_extensions
    """ % src)
Exception: Cython-generated file 'pandas/parser.c' not found.
                Cython is required to compile pandas from a development branch.
                Please install Cython or download a release package of pandas.

@gliptak what is the output of ci/print_versions.py

here's mine just for reference

INSTALLED VERSIONS
------------------
Python: 2.7.5.final.0
OS: Linux 3.9.4-1-ARCH #1 SMP PREEMPT Sat May 25 16:14:55 CEST 2013 x86_64
LC_ALL: None
LANG: en_US.UTF-8

Cython: 0.20dev
Numpy: 1.8.0.dev-b5fd429
Scipy: 0.13.0.dev-a1b358f
statsmodels: 0.5.0.dev-917da60
    patsy: 0.1.0+dev
scikits.timeseries: 0.91.3
dateutil: 2.1
pytz: 2013b
bottleneck: 0.7.0dev
PyTables: 3.0.0
    numexpr: 2.1.1.dev
matplotlib: 1.4.x
openpyxl: 1.6.2
xlrd: 0.9.3dev
xlwt: 0.7.5
sqlalchemy: 0.8.1
lxml: 3.2.1
bs4: 4.3.0
html5lib: 0.95-dev

@cpcloud

$ ci/print_versions.py 

INSTALLED VERSIONS
------------------
Python: 2.7.4.final.0
OS: Linux 3.8.0-23-generic #34-Ubuntu SMP Wed May 29 20:22:58 UTC 2013 x86_64
LC_ALL: None
LANG: en_US.UTF-8

Cython: Not installed
Numpy: 1.7.1
Scipy: 0.12.0
...

It is a Virtualenv, and it was not seeing the "global" cython.

I run pip install cython, and that corrected it.

Thank you for the pointers.

Hi
I also have the same problem. This below was displayed

Exception:
Cython-generated file 'pandas/algos.c' not found.
Cython is required to compile pandas from a development branch.
Please install Cython or download a release package of pandas.

And I run pip install cython , but

Requirement already satisfied: Cython in /macqiime/anaconda/lib/python2.7/site-packages` was displayed because I already installed python and run setup.py.

How should I do ? Could you give me any advise ?

As indicated above, make sure you install cython in the correct environment.

@jorisvandenbossche
Ok thank you.

@jorisvandenbossche I have the same problem with pandas installation on alpine.
I installed cython library but nothing happened
(https://travis-ci.org/github/Monogramm/docker-erpnext/jobs/713286142)

Was this page helpful?
0 / 5 - 0 ratings