Jump to content

New Module... Import requests


90N45
Go to solution Solved by dark_pyrro,

Recommended Posts

I am in the process of building a new module for the MK7. I am using a python package called Requests but unfortunately the pineapple does not have this package installed.

For personal testing, how can I install pip to use Requests? (opkg install python3-pip failed).

For publishing in the Hak5 GitHub module repository: How can it be pushed, if nobody got this python package by default?

 

To use this package is literally my final important step to get this new module working. I saw some other modules using urllib.request instead of Requests and now I will try out this... but I would still like to know if I could have used requests by chance.

Link to comment
Share on other sites

  • Solution
3 hours ago, 90N45 said:

how can I install pip to use Requests? (opkg install python3-pip failed)

Not sure why it fails when you try doing it, it works for me;
 

opkg update

opkg install python3-pip

python -m pip install requests

 

3 hours ago, 90N45 said:

How can it be pushed, if nobody got this python package by default?

Have you been reading the developer docs? For example:

https://hak5.github.io/mk7-docs/docs/python/helpers/opkg_helpers/opkg_helpers/

 

Link to comment
Share on other sites

I must have forgotten the opkg update... Well now I switched to urllib.parse. Makes more sense anyway, since it is already preinstalled with Python3 but good that this is cleared up now!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...