在Cloud9中安装Python模块
我很难在Cloud9IDE中安装某些Python模块 我尝试过使用easy_install(他们推荐的方法)和pip,但使用这两种方法,我得到了大量警告,并以错误结束(请查找下面的错误消息) 我已经了解到内存问题可能是问题所在,一个可能的解决方案是增加交换空间,但显然Cloud9不允许,因为在Cloud9中安装Python模块,python,pandas,cloud9-ide,Python,Pandas,Cloud9 Ide,我很难在Cloud9IDE中安装某些Python模块 我尝试过使用easy_install(他们推荐的方法)和pip,但使用这两种方法,我得到了大量警告,并以错误结束(请查找下面的错误消息) 我已经了解到内存问题可能是问题所在,一个可能的解决方案是增加交换空间,但显然Cloud9不允许,因为sudo swapon/swap1无法显示不允许的操作 有人在Cloud9中安装过熊猫吗?我还应该试试别的方法吗 更新:我使用Linux发行版的软件包管理器安装了pandas:sudo apt get ins
sudo swapon/swap1
无法显示不允许的操作
有人在Cloud9中安装过熊猫吗?我还应该试试别的方法吗
更新:我使用Linux发行版的软件包管理器安装了pandas:sudo apt get install python pandas
但是我得到了版本0.13,我需要当前版本0.16才能使用pandasql
这就是我要做的sudo easy\u安装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
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)
我创建了两个脚本来完成这项工作: 脚本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\u name
安装任何软件包。我更喜欢使用以下命令下载主软件包
wget
然后按照Continuum中的说明使用以下步骤安装它
bash Anaconda3-4.2.0-Linux-x86_64.sh
它安装了所有东西,包括conda、pip、numpy、scipy和matplotlib等。我在尝试安装pandas版本0.20.3时遇到了同样的问题。我认为问题在于默认情况下virtualenv将安装Python 2,而pandas的这个版本可能无法在其上运行 我的解决方案是在cloud 9中使用Python 3创建环境:
virtualenv -p python3 test
然后激活环境:
source test/bin/activate
更新setuptools和pip:
pip install -U setuptools
pip install -U pip
并使用pip安装熊猫:
pip install pandas
确实如此。问题提出后,情况可能发生了变化,但我发现我可以使用Python 3 pip,方法如下:
$ sudo pip-3.6 install pandas
请注意,符号似乎是
pip-3.6
,而不是典型的pip3
,我不确定我使用的是哪个版本的Cloud9。但在de功能目录内的终端上,使用以下命令:
venv/bin/pip安装熊猫-t.
一直有效使用康达怎么样?我从安装miniconda,然后运行conda安装pandas来安装pandas。我已经安装了Anaconda,但我喜欢Cloud9,也希望能够使用它。您可以将conda或Anaconda安装到cloud9@HYRY谢谢你的帮助!如果你愿意,你可以把你的评论变成回答。