Can't install python package with pip



  • Before this summer I was able to install the python package Requests with pip, but not any longer. I wonder if my problem is related to some new update or if I'm doing something wrong.

    Can some of you try to see if you are able to install the Requests package, which I need for handling REST (put/get). These are the commands that I use:

    • opkg install python3
    • opkg install python3-pip
    • pip3 install requests

    The last command ('pip3 install requests') will make the Onion Omega 2 hanging and after a couple of minutes a stack trace is shown.
    I use omega2-v0.1.10-b160.bin, Python 3.6.0.

    Here is the console log



  • it appears that the omega2 is having memory issues. there is a message of 0 swap pages so perhaps setting up a swap file would help?



  • Hi, I used to get a similar error when I tried to install pip & virtualenv for python2, I got it to work by booting from a USB stick (https://docs.onion.io/omega2-docs/boot-from-external-storage.html). I just tried your steps now on my Omega and it worked fine.

    root@Omega-46A5:~# pip3 install requests
    Collecting requests
      Using cached requests-2.18.4-py2.py3-none-any.whl
    Collecting urllib3<1.23,>=1.21.1 (from requests)
      Using cached urllib3-1.22-py2.py3-none-any.whl
    Collecting idna<2.7,>=2.5 (from requests)
      Using cached idna-2.6-py2.py3-none-any.whl
    Collecting chardet<3.1.0,>=3.0.2 (from requests)
      Using cached chardet-3.0.4-py2.py3-none-any.whl
    Collecting certifi>=2017.4.17 (from requests)
      Using cached certifi-2017.7.27.1-py2.py3-none-any.whl
    Installing collected packages: urllib3, idna, chardet, certifi, requests
    Successfully installed certifi-2017.7.27.1 chardet-3.0.4 idna-2.6 requests-2.18.4 urllib3-1.22
    root@Omega-46A5:~# python3
    Python 3.6.0 (default, Sep 18 2017, 20:34:00)
    [GCC 5.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import requests
    >>>
    


  • @Douglas-Kryder and @Gabriel-Gabor. Thanks for your replies.

    Gabriel, your post shows that it is possible, which gives me hope. This week I have followed the link that you posted, but with no success. I have executed the procedure many times, with different Omega2 units. It is strange that I seem to have enough memory left after the crash.

    This is how it looks like after I have get the stack dump after typing 'pip3 install requests':

    ...
    [  530.773422] [ 1842]     0  1842      297       11       3       0        0             0 ntpd
    [  530.782072] [ 3146]     0  3146     9903     7633      13       0        0             0 pip3
    [  530.790729] Out of memory: Kill process 3146 (pip3) score 488 or sacrifice child
    [  530.798257] Killed process 3146 (pip3) total-vm:39612kB, anon-rss:30524kB, file-rss:8kB
    Killed
    root@Omega-6895:/# df -h
    Filesystem                Size      Used Available Use% Mounted on
    /dev/root                 5.5M      5.5M         0 100% /rom
    tmpfs                    29.7M      3.3M     26.3M  11% /tmp
    /dev/sda1                14.0G     75.0M     13.2G   1% /overlay
    overlayfs:/overlay       14.0G     75.0M     13.2G   1% /
    tmpfs                   512.0K         0    512.0K   0% /dev
    root@Omega-6895:/# 
    


  • Today I bought a new USB-memory and made another attempt to install the Requests-package, but with no success. So my problem doesn't seems to be related to any hardware issue (the Omega2 unit nor the USB-memory).

    I will give the Omega2 one more week and if I don't succeed then I will leave it and go for a Raspberry Pi.



  • Here is the latest status regarding this issue.

    I have followed the instructions in the link above for more than ten times, but with no luck. This week I gave up.

    Instead of using the requests-package, I have now rewritten my python3 script to use the urllib package instead. Urllib is already included in python3 and gives me the same functionality as I was planning to get from the requests-package.


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.