- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试安装 spaCy,一个用于自然语言处理的库。
root@vps:~# python3 -m pip install spacy
Collecting spacy
Using cached https://files.pythonhosted.org/packages/8f/ac/f7a56f8de3bd29384247babb327b7f3c0e3ddef40d1eff8ae993e6d4d2ba/spacy-2.1.6-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: spacy
Killed
过了一会儿,它被杀死了。我已经在 Stack Overflow 上寻找答案并尝试过,这是由于内存不足(我的 VPS 上有 1.2 Gb 可用,无法扩展)。快速 tail -f/var/log/kern.log
给我 Out of memory: Kill process 31729 (python3) score 558 or sacrific child
.
我已经尝试添加 --no-cache-dir
,但没有帮助。手动复制文件时似乎缺少某些内容。有什么方法可以在低 RAM 服务器上安装此软件包?
编辑:python3 -m pip install spacy -vvv
Converted retries value: Retry(total=5, connect=None, read=None, redirect=None) -> Retry(total=Retry(total=5, connect=None, read=None, redirect=None), connect=N one, read=None, redirect=None)
Converted retries value: Retry(total=5, connect=None, read=None, redirect=None) -> Retry(total=Retry(total=5, connect=None, read=None, redirect=None), connect=N one, read=None, redirect=None)
Collecting spacy
1 location(s) to search for versions of spacy:
* https://pypi.python.org/simple/spacy/
Getting page https://pypi.python.org/simple/spacy/
Looking up "https://pypi.python.org/simple/spacy/" in the cache
Returning cached "301 Moved Permanently" response (ignoring date and etag info rmation)
Looking up "https://pypi.org/simple/spacy/" in the cache
Current age based on date: 29458
Freshness lifetime from max-age: 600
Freshness lifetime from request max-age: 600
Starting new HTTPS connection (1): pypi.org
https://pypi.org:443 "GET /simple/spacy/ HTTP/1.1" 304 0
Analyzing links from page https://pypi.org/simple/spacy/
<!-- Found link, skipped linked (hundreds of lines) -->
Found link https://files.pythonhosted.org/packages/a7/84/f35f44560f0ab9ef23c 4a334a513f2b6c8a95d7b3347ef68a0247da63c08/spacy-2.1.6.tar.gz#sha256=b708bb582597 6220de78ad7e20e827912ca95653738a812cc2e5d194e3060ae8 (from https://pypi.org/simp le/spacy/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 2.1 .6
Using version 2.1.6 (newest of versions: 0.31, 0.32, 0.33, 0.40, 0.51, 0.52, 0 .60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.67, 0.68, 0.70, 0.80, 0.81, 0.82, 0.83, 0.8 4, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.97, 0.98, 0.99, 0.100.0, 0.100.1, 0.100.2, 0.100.3, 0.100.4, 0.100.5, 0.100.6, 0.100.7, 0 .101.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.3.0, 1. 4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.5, 1.8.0, 1.8.1, 1.8.2 , 1.9.0, 1.10.0, 1.10.1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.15, 2.0.16, 2.0.17, 2.0.18, 2 .1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6)
Looking up "https://files.pythonhosted.org/packages/8f/ac/f7a56f8de3bd29384247 babb327b7f3c0e3ddef40d1eff8ae993e6d4d2ba/spacy-2.1.6-cp35-cp35m-manylinux1_x86_6 4.whl" in the cache
Current age based on date: 98439
Freshness lifetime from max-age: 365000000
The response is "fresh", returning cached response
365000000 > 98439
Using cached https://files.pythonhosted.org/packages/8f/ac/f7a56f8de3bd2938424 7babb327b7f3c0e3ddef40d1eff8ae993e6d4d2ba/spacy-2.1.6-cp35-cp35m-manylinux1_x86_ 64.whl
Downloading from URL https://files.pythonhosted.org/packages/8f/ac/f7a56f8de3b d29384247babb327b7f3c0e3ddef40d1eff8ae993e6d4d2ba/spacy-2.1.6-cp35-cp35m-manylin ux1_x86_64.whl#sha256=2441ad9e6195669c13f4035dd77c4206414a40ebb8543c69f3386d984a bfb942 (from https://pypi.org/simple/spacy/) (requires-python:>=2.7,!=3.0.*,!=3. 1.*,!=3.2.*,!=3.3.*)
Requirement already satisfied: plac<1.0.0,>=0.9.6 in /usr/local/lib/python3.5/di st-packages (from spacy)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.5/d ist-packages (from spacy)
Requirement already satisfied: srsly<1.1.0,>=0.0.6 in /usr/local/lib/python3.5/d ist-packages (from spacy)
Requirement already satisfied: blis<0.3.0,>=0.2.2 in /usr/local/lib/python3.5/di st-packages (from spacy)
Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3 .5/dist-packages (from spacy)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/pytho n3.5/dist-packages (from spacy)
Requirement already satisfied: wasabi<1.1.0,>=0.2.0 in /usr/local/lib/python3.5/ dist-packages (from spacy)
Requirement already satisfied: thinc<7.1.0,>=7.0.8 in /usr/local/lib/python3.5/d ist-packages (from spacy)
Requirement already satisfied: preshed<2.1.0,>=2.0.1 in /usr/local/lib/python3.5 /dist-packages (from spacy)
Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.5/dist-pa ckages (from spacy)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/l ocal/lib/python3.5/dist-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.5/dist-p ackages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.5/di st-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python3.5 /dist-packages (from requests<3.0.0,>=2.13.0->spacy)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in /usr/local/lib/python3.5/d ist-packages (from thinc<7.1.0,>=7.0.8->spacy)
Installing collected packages: spacy
Killed
最佳答案
这已经在github上报道过了
https://github.com/explosion/spaCy/issues/3396
下面是一些关于如何解决问题的好帖子
fork() failing with Out of memory error
Memory error while using pip install Matplotlib
out of memory issue in installing packages on Ubuntu server
https://chirale.org/2017/01/15/memory-error-on-pip-install-solved/
在摘要中,以下是两个选项:
尝试使用 --no-cache-dir
,不幸的是,它对您没有帮助
增加交换空间
$ create swap file of 512 MB
dd if=/dev/zero of=/swapfile bs=1024 count=524288
$ modify permissions
chown root:root /swapfile
chmod 0600 /swapfile
$ setup swap area
mkswap /swapfile
$ turn swap on
swapon /swapfile
关于python - Pip install killed - 内存不足 - 如何绕过它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57058641/
pip install 和 pip download 有什么区别? $ pip --version pip 9.0.1 from c:\users\nahawk\python\python27\lib
我的控制台: desarrollador@desarrollador-HP-14-Notebook-PC1:~$ pip freeze Exception: Traceback (most rec
我用 pip 安装: $ sudo apt-get install python-setuptools, python-pip 但是当我尝试使用 pip 安装某些东西时出现此错误 sudo pip i
我通过 yum 安装了 python-pip 包(使用 Fedora 的更新仓库)。它不会将 pip 脚本添加到我的 PATH 中。 $ which pip /usr/bin/which: no pi
在Windows上使用python。当我尝试使用以下命令安装新库时。它会抛出错误,指出‘pip’未被识别为内部或外部命令、可操作程序或批处理文件。。但是当我使用代码的时候。它给了我一个有效的结果。。为
我收到了消息 You are using pip version 8.0.2, however version 8.1.2 is available. You should consider upgr
我安装了一个版本的包(例如 transformers 3.4.0) 我想安装一个较早的版本。我安装: pip install transformers==3.1.0 检查安装的版本时 pip free
我最近决定尝试在我的计算机上安装 tesseract 并运行 pip3 install tesseract-ocr。 然后它开始下载 cython,这提醒我 tesseract-ocr 不是我想要的,
默认情况下,pip搜索软件包名称和描述。对于某些软件包,这会导致大量的伪造命中,而找到我真正想要的伪命中是一件痛苦的事情。 我如何告诉点子我只想按名称搜索? 最佳答案 目前尚不可行,因为当前实现(第8
我如何使用 pip在 oh-my-zsh 中?我正在尝试安装 nltk通过 pip,但它告诉我 zsh: command not found: pip .当我查看 .oh-my-zsh/custom/
我有一个pip要求文件,其中包括Torch和Torchvision的特定于CPU的特定版本。我可以使用以下pip命令成功安装我的需求。 pip install --requirement azure-
pip 有一个 -q/--quiet 标志,可以从命令行理想地工作。我正在使用自动部署过程 (Amazon Elastic Beanstalk),并且这些工具使用 pip 从需求文件进行安装。 不幸的
我有一个带有附加功能的软件包,通常可以使用以下命令进行安装。 pip install package[extras] 但是,我也可以通过轮子安装相同的包,指定一些轮子 URL,如下所示。 pip in
我试过pip freeze 。我需要它只输出由换行符分隔的模块,例如 pip freeze ,除非没有版本号,因为我正在尝试创建一个自动升级程序,并且想要执行 pip install --upgrad
我尝试在pip.conf中使用带有index-url的pip。但是,我无法确保我们可以获得所有必需的 python 库。所以,我想知道 pip 支持是否在 pip.conf 的 [global] 部分
如何列出我直接使用 pip 安装的软件包, 省略已安装的任何依赖项? 我有一个运行的 virtualenv,命令如下 $ pip install A B C $ pip install X Y Z 因
这个问题在这里已经有了答案: How to upgrade all Python packages with pip (50 个回答) 2年前关闭。 我有一个 bash 命令来升级我安装的所有 pip
我正在尝试使用 ssh 运行一些 python 脚本以登录到谷歌计算引擎,但由于我没有权限访问我的用户中的 .cache/pip 文件夹,所以找不到所有已安装的 pip 模块是否有正确的方法来执行此操
有没有办法告诉 pip 永远不要为我的包创建轮缓存? 背景 我编写了一个供内部使用的包,当使用 setup.py 中的 cmdclass 安装时,它会设置一些符号链接(symbolic link)。如
我看过类似的帖子 pip install vs python3 -m pip install 这并没有真正澄清这个问题。 我是 Python 新手,只是遵循基本的 python 3 教程,他们提到 p
我是一名优秀的程序员,十分优秀!