在Cloud9中安装Python模块pandas

twa*_*aum 7 python cloud9-ide pandas

我很难在Cloud9 ide中安装某些Python模块.

我已经尝试过使用easy_install(他们推荐的方法)和pip,但是我得到了大量警告并以错误结束(找到下面的错误消息).

我已经读过内存问题可能是问题,并且可能的解决方案是增加交换空间,但显然Cloud9不允许它,因为sudo swapon /swap1显示失败Operation not permitted

有没有人在Cloud9中安装过熊猫?我应该尝试其他任何方法吗?

更新:我设法使用Linux发行版的软件包管理器安装pandas:sudo apt-get install python-pandas但是我得到版本0.13,我需要当前版本0.16才能使用pandasql.

这就是我要做的事情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
Run Code Online (Sandbox Code Playgroud)

这就是我要做的事情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)
Run Code Online (Sandbox Code Playgroud)

Han*_*ann 8

我创建了2个脚本来完成这项工作:

脚本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'
Run Code Online (Sandbox Code Playgroud)

脚本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
Run Code Online (Sandbox Code Playgroud)

我已经安装了不仅仅是pandas,因此您可以在脚本中看到,您可以使用任何软件包安装 conda install package_name


小智 5

自从提出问题以来,事情可能已经发生了变化,但是我发现我可以通过以下方式使用Python 3 pip:

$ sudo pip-3.6 install pandas    
Run Code Online (Sandbox Code Playgroud)

请注意,该符号似乎pip-3.6不是典型的pip3