Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandas build on Cygwin

I tried building pandas on Cygwin and run into an error building pandas.msgpack._packer:

building 'pandas.msgpack._packer' extension

The error is:

gcc: error: spawn: No such file or directory

And here's the build command:

gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/build=/usr/src/debug/python3-3.4.3-1 -fdebug-prefix-map=/usr/src/ports/python3/python3-3.4.3-1.x86_64/src/Python-3.4.3=/usr/src/debug/python3-3.4.3-1 -D__LITTLE_ENDIAN__=1 -Ipandas/src/msgpack -Ipandas/src/klib -Ipandas/src -I/tmp/pip-build-mdmyz2dz/pandas/.eggs/numpy-1.10.2-py3.4-cygwin-2.3.1-x86_64.egg/numpy/core/include -I/usr/include/python3.4m -c pandas/msgpack/_packer.cpp -o build/temp.cygwin-2.3.1-x86_64-3.4/pandas/msgpack/_packer.o

I'm guessing that gcc isn't finding pandas/src/msgpack and its subdirectories because the prior builds use all the other links except for these.

I guess, my question is, has anyone tried to install pandas on Cygwin's python? If not, any clues on what's going on here?

like image 996
fpes Avatar asked Dec 17 '15 17:12

fpes


People also ask

Can Cygwin run Python?

Installing Python for Cygwin. Packages are installed for Cygwin using its setup utility, setup-x86_64.exe for 64-bit (source: http://cygwin.com/install.html). By default, the Cygwin setup utility asks for elevated Administrative permissions. These are not necessary to install and update the base Cygwin environment.

Can PyCharm use pandas?

csv file onto PyCharm using Pandas? Pandas is a widely popular library used for data analysis and manipulation in Python. You need to import the pandas package to use it. To do so, go to File menu >> Settings >> Python Interpreter >> Search for pandas >> install package.


4 Answers

Install the following packages in cygwin :

python2-numpy
python2-six
python2-wheel
python2-setuptools
python2-pip
python2-cython
gcc-core
gcc-fortran
gcc-g++
make
wget

And then in Cygwin Terminal, build and install

pip2 install pytz python-dateutil
pip2 install pandas
like image 104
ijkl Avatar answered Oct 14 '22 09:10

ijkl


I successfully built pandas 0.18.1, I had to install gcc-g++.

If you're using baboon: pact install gcc-g++

like image 43
fedterzi Avatar answered Oct 14 '22 09:10

fedterzi


this below is taken from another website, https://wiki.usask.ca/display/MESH/Running+Python+from+the+Cygwin+Terminal.

I report the steps below but all credit goes to the original writer.

Configuring Cygwin

Download and run the Cygwin installer: setup-x86.exe for 32-bit or setup-x86_64.exe for 64-bit (source: http://cygwin.com/install.html).

Search for and mark the following packages for installation:

  • \All\Devel\make
  • \All\Devel\gcc-core
  • \All\Devel\gcc-fortran
  • \All\Devel\gcc-g++
  • \All\Python\python
  • \All\Web\wget

Installing Python

Run "Cygwin Terminal" (mintty.exe) as an Administrator. Install Python using the following command:

wget https://bootstrap.pypa.io/ez_setup.py -O - | python

Install additional packages, as required:

easy_install --upgrade numpy
easy_install "python-dateutil==1.5"
easy_install --upgrade pytz
easy_install --upgrade pandas
like image 20
fabiog Avatar answered Oct 14 '22 09:10

fabiog


For Python3.7 + on Cygwin do the following.

These instructions assume that python3 Cygwin package is not installed.

Install latest versions of following Packages using the Cygwin installer:

python37
python37-pip
python37-setuptools
python37-devel

Open the Cygwin terminal and run the following steps there.

Create symlink for /usr/bin/python3:

% ln -s /usr/bin/python3.7 /usr/bin/python3

Upgrade pip:

% python3 -m pip install --upgrade pip

Upgrade other packages:

% python3 -m pip list --outdated

... for each package that is outdated run:

% python3 -m pip install --upgrade <package>

Install pandas and dependencies (note: this takes quite a while):

% python3 -m pip install cython wheel pandas
like image 2
Timothy C. Quinn Avatar answered Oct 14 '22 07:10

Timothy C. Quinn