Pip install killed - out of memory - how to get around it?

后端 未结 3 1975
醉梦人生
醉梦人生 2021-01-18 06:15

I\'m trying to install spaCy, a library for natural language processing.

root@vps:~# python3 -m pip install spacy
Collecting spacy
  Using cached https://fil         


        
相关标签:
3条回答
  • 2021-01-18 06:23

    not sure if this will work but have you tried compiling from source? this script is at Spacy's pypi page. No idea if this would manage RAM constraint better than regular pip install but it's something I would try.

    # make sure you are using the latest pip
    python -m pip install -U pip
    git clone https://github.com/explosion/spaCy
    cd spaCy
    
    python -m venv .env
    source .env/bin/activate
    export PYTHONPATH=`pwd`
    pip install -r requirements.txt
    python setup.py build_ext --inplace
    
    0 讨论(0)
  • 2021-01-18 06:30

    Try adding swap space to your VPS. That will let you use free disk space as memory

    0 讨论(0)
  • 2021-01-18 06:33

    This has been reported already on github

    https://github.com/explosion/spaCy/issues/3396

    Below are some good thread on how to solve the issue

    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/

    In Summary, below are the two options:

    1. Try with --no-cache-dir, which unfortunately has not helped you

    2. Increase the swap space

    $ 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
    
    0 讨论(0)
提交回复
热议问题