Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Python module pandas in Cloud9

I'm having a hard time installing certain Python modules in Cloud9 ide.

I have tried using easy_install (their recommended method) and pip but with both I get a ton of warnings and end with errors (find the error messages below).

I have read that memory issues might be the problem, and that a possible solution is to increase the swap space, however apparently Cloud9 does not allow it, since sudo swapon /swap1 fails showing Operation not permitted

Anyone ever installed pandas in Cloud9? Any other method I should try?

UPDATE: I managed to install pandas using the Linux distribution’s package manager: sudo apt-get install python-pandas however I get the version 0.13 and I need the current version 0.16 to use pandasql.

This is what I get doing sudo easy_install pandas:

x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report, with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 4

This is what I get doing pip install pandas:

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)
like image 380
twalbaum Avatar asked Jul 23 '15 22:07

twalbaum


1 Answers

I created 2 scripts to do the job:

script 01:

#! /bin/bash

#Downloading Miniconda 64Bits for Linux
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

#Changing file permission for execution
chmod a+x Miniconda3-latest-Linux-x86_64.sh

#Installing Miniconda
./Miniconda3-latest-Linux-x86_64.sh

# Follow instructions to complete install

# Close and reopen terminal.
echo 'Please close the terminal reopen and run install02.sh script now'

Script 02:

#! /bin/bash

# Creating environment (sandbox instance called py3 [choose the name you want])
conda create -n py3 python=3 ipython

# Activating created environment
source activate py3

# Install package manager pip
conda install pip

# The installation installs the packages
#pip install numpy
#pip install pandas
#pip install matplotlib

# which ipython is to be used in the environment? pip freeze shows it
pip freeze

# Installing ipython notebook
conda install ipython-notebook

# Installing the packages
conda install numpy
conda install pandas
conda install matplotlib

I have installed more than only pandas, so as you can see in the script you can install any package using conda install package_name

like image 54
Hans Zimermann Avatar answered Sep 21 '22 15:09

Hans Zimermann