gpt4 book ai didi

python - 在 Cloud9 中安装 Python 模块 pandas

转载 作者:太空狗 更新时间:2023-10-29 21:23:56 27 4
gpt4 key购买 nike

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

我尝试过使用 easy_install(他们推荐的方法)和 pip,但我都收到大量警告并以错误结束(在下面找到错误消息)。

我读到内存问题可能是问题所在,一个可能的解决方案是增加交换空间,但显然 Cloud9 不允许这样做,因为 sudo swapon/swap1 无法显示 不允许操作

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

更新:我设法使用 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

这就是我正在做的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)

最佳答案

我创建了 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'

脚本 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

我不仅安装了 pandas,所以正如您在脚本中看到的,您可以使用 conda install package_name 安装任何包

关于python - 在 Cloud9 中安装 Python 模块 pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31598883/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com