python - 安装 Pandas : UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)

标签 python linux pandas installation server

我在 Linux 服务器上安装 pandas 时遇到一些问题 我正在尝试安装它,它创建了自己的 venv,我的要求文件如下所示:

Flask==0.10.1
pandas==0.16.2

本地安装正确,但仅在服务器上安装,由于某些我无法理解的原因,我无法执行此操作。

我试图找到解决方案,但我不明白可能是什么问题?请帮助我!

我的错误看起来像这样

enter image description here

所以:

Command /var/www/jsonify-it/venv/bin/python -c "import setuptools;__file__='/var/www/jsonify-it/venv/build/pandas/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-B_NcK3-record/install-record.txt --single-version-externally-managed --install-headers /var/www/jsonify-it/venv/include/site/python2.7 failed with error code 1 in /var/www/jsonify-it/venv/build/pandas
Traceback (most recent call last):
  File "/var/www/jsonify-it/venv/bin/pip", line 9, in <module>
    load_entry_point('pip==1.4.1', 'console_scripts', 'pip')()
  File "/var/www/jsonify-it/venv/local/lib/python2.7/site-packages/pip/__init__.py", line 148, in main
    return command.main(args[1:], options)
  File "/var/www/jsonify-it/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128)
Installation complete.

我不明白这可能是什么问题?请帮忙!

更新: 解决方案:

最后我发现了我的问题: 我这样做了:

sudo apt-get install g++

那么解决方案(如果您无法增加该计算机上的内存)是添加交换文件。

sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

最佳答案

新版本的pip解决了这个问题。更新 pip 即可解决问题。 pip 安装 --升级 pip

关于python - 安装 Pandas : UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 72: ordinal not in range(128),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36892261/

相关文章:

python套接字错误10060

linux - 使用批处理文件从 Windows 计算机在远程 Linux 计算机上运行自定义命令

python - 使用唯一值列表 reshape pandas 数据框

linux - Linux 中两条看似等效的路径,一条有效,一条无效

python - DHCP请求库

python - 使用 SQLAlchemy 批量插入 Pandas 数据帧

python - 使用for循环过滤范围之间数据框的列?

python - 从列表中仅替换数据框中的几个标题

python - Django Admin 中的嵌套内联

python - 将列表的 Pandas 数据框列转换为每列的 numpy 数组