Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python2.7.5 不能正确安装 #98

Closed
liuxiawei opened this issue Sep 18, 2017 · 6 comments
Closed

python2.7.5 不能正确安装 #98

liuxiawei opened this issue Sep 18, 2017 · 6 comments
Labels

Comments

@liuxiawei
Copy link

pip install pypinyin
源码在编译时出错,上一句为
byte-compiling build/bdist.linux-x86_64/egg/pypinyin/phrases_dict.py to phrases_dict.pyc
此时未报错,直接显示为killed,下载源码也一样。求解

@mozillazg
Copy link
Owner

@liuxiawei
你试试:

  • 机器的内存是否不够
  • 内存够的话,升级一下 pip 后再试试: pip install -U pip
  • 安装时使用 -v 参数看看具体日志: pip install pypinyin -v

@mozillazg
Copy link
Owner

这个问题无法复现。

@aka863
Copy link

aka863 commented Nov 14, 2017

我在bandwagonhost的vps上也遇到了这个问题。
操作系统是 Debian 8.0 x86_64,内存256MB。
无论是使用系统自带的pip2,还是自己编译安装的python3.6,都会被killed。
网上搜了搜,有人说是内存不足造成的。
因为是精简版的debian,在/var/log中找不到相应的log。

root@localhost:/var/log# pip install pypinyin
Collecting pypinyin
Using cached pypinyin-0.27.0-py2.py3-none-any.whl
Requirement already satisfied: enum34; python_version < "3.4" in /usr/local/lib/python2.7/dist-packages (from pypinyin)
Installing collected packages: pypinyin
Killed

@mozillazg
Copy link
Owner

@aka863 是的,一般终端输出 Killed 都是内存超了的原因。你可以在执行 pip 命令前先看一下剩余内存(通过 free 命令查看)。

@xiaomiba0904
Copy link

我也出现同样的问题,内存在200M左右出现Killed,空出300以上就可以解决了

@zgdlime
Copy link

zgdlime commented Sep 1, 2018

@liuxiawei
请问python-pinyin如何批量处理?

运行环境
操作系统:Windows10
Python 版本:python-3.4.3
pypinyin 版本:v0.33.0

我有一个文本文件b.txt,utf-8格式,文件里面有内容:
这个
进行
因为
还是
时候
看到
……
想把转换成汉语拼音,该如何操作?

能批处理、拖叠文件等一步到位吗?
指教一下吧!谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants