Can not import urequests

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
shallwe
Posts: 2
Joined: Thu Nov 07, 2019 9:29 am

Can not import urequests

Post by shallwe » Thu Nov 07, 2019 9:34 am

In the bin below, I can not import urequests, it shows "can not import, module not exists"

esp32spiram-idf3-20191107-v1.11-563-g4be316fb0.bin
esp32-idf3-20191107-v1.11-563-g4be316fb0.bin
esp32-idf4-20191107-v1.11-563-g4be316fb0.bin


But with the bin I download three month ago, named "esp32-20190831-v1.11-265-g12f13ee63.bin"

I can import urequests.

What happened?

User avatar
jimmo
Posts: 892
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Can not import urequests

Post by jimmo » Thu Nov 07, 2019 11:34 am

I think these new builds must be being done with the default manifest, rather than the release one.

In the meantime

Code: Select all

import upip
upip.install('micropython-urequests')
I'll find out about getting the nightly builds fixed to use the release manifest.

User avatar
jimmo
Posts: 892
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Can not import urequests

Post by jimmo » Fri Nov 08, 2019 5:50 am

This should be fixed from the next build (which is in about 12 hours time)

shallwe
Posts: 2
Joined: Thu Nov 07, 2019 9:29 am

Re: Can not import urequests

Post by shallwe » Fri Nov 08, 2019 6:52 am

with the latest bin: esp32-idf3-20191108-v1.11-571-g7e374d231.bin
still not available

>>> upip.install('micropython-urequests')
Installing to: /lib/
Error installing 'micropython-urequests': list index out of range, packages may be partially installed
>>> upip.install('micropython-urequests')
Installing to: /lib/
Error installing 'micropython-urequests': list index out of range, packages may be partially installed
>>> import urequests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'urequests'
>>>

User avatar
jimmo
Posts: 892
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Can not import urequests

Post by jimmo » Fri Nov 08, 2019 7:42 am

It hasn't been 12 hours yet. You'll need to wait for the next build (they happen automatically).

paulg
Posts: 16
Joined: Fri Oct 23, 2015 1:06 pm

Re: Can not import urequests

Post by paulg » Fri Nov 08, 2019 11:48 pm

The following worked for me:

>>> <establish a network connection as a station>
>>> import upip
>>> upip.install('urequests')

upip will install urequests in /lib on your ESP32 board

Post Reply