Home > Net >  How to build pandas on Cygwin (for Python2.7)?
How to build pandas on Cygwin (for Python2.7)?

Time:08-03

I am maintaining some legacy code and for that reasons using python 2.7. Answers to similar questions on SO have helped me make some progress on this issue, so the following packages (and their dependencies) have been successfully installed:

python27-devel
python27-cython

pip2.7 install pandas produces the following output (cut for brevity):

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pandas
  Using cached pandas-0.24.2.tar.gz (11.8 MB)
Requirement already satisfied: python-dateutil>=2.5.0 in /usr/lib/python2.7/site-packages (from pandas) (2.8.2)
Requirement already satisfied: pytz>=2011k in /usr/lib/python2.7/site-packages (from pandas) (2022.1)
Requirement already satisfied: numpy>=1.12.0 in /usr/lib/python2.7/site-packages (from pandas) (1.16.2)
Requirement already satisfied: six>=1.5 in /usr/lib/python2.7/site-packages (from python-dateutil>=2.5.0->pandas) (1.16.0)
Building wheels for collected packages: pandas
  Building wheel for pandas (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g01aru/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g01aru/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-8RPw92
       cwd: /tmp/pip-install-g01aru/pandas/
  Complete output (2435 lines):
  ...
  [a lot of warnings cut out, the only error follows]
  ...
  pandas/_libs/window.cpp: In function ‘PyObject* initwindow()’:
  pandas/_libs/window.cpp:67892:3: error: return-statement with no value, in function returning ‘PyObject*’ {aka ‘_object*’} [-fpermissive]
  67892 |   return;
        |   ^~~~~~
  pandas/_libs/window.cpp: At global scope:
  pandas/_libs/window.cpp:679:24: warning: ‘const char* get_c_string(PyObject*)’ defined but not used [-Wunused-function]
    679 |     static const char* get_c_string(PyObject* obj) {
        |                        ^~~~~~~~~~~~
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pandas
  Running setup.py clean for pandas

How to proceed with the given error?

CodePudding user response:

To answer my own question and perhaps help someone with the same issue:

It looks like pandas 0.24.2 doesn't get along with python2.7 on cygwin. The error did not happen when I installed the pandas version 0.23.0 with the following command:

pip2.7 install pandas==0.23.0

  • Related