<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CoreS3 &amp; HTTP Request block: urequests import error]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I have started tinkering with the M5Stack and am finding it a very useful device. I can certainly see lots of potential.</p>
<p dir="auto">I wanted to test sending a POST HTTP request to a WLED device running on my network.</p>
<p dir="auto">I have tested the syntax outside of UiFlow 2.0 to be sure I have it correct.</p>
<p dir="auto">However, when I send the code to the device, I just get a blank screen.</p>
<p dir="auto">Also, when I tried sending it over the USB serial port, I encountered an error message...</p>
<p dir="auto"><strong>ImportError: no module named 'urequests'</strong></p>
<p dir="auto">I have also tried a simple GET http request shown in the documentation and still got the same error.</p>
<p dir="auto">I am using v2.01 of UiFlow and have burned the latest to the device.</p>
<p dir="auto">A lot of searching didn't really get me to any simple solution.</p>
<p dir="auto">Any thoughts would be welcome.</p>
<p dir="auto">Many thanks in advance.</p>
]]></description><link>https://community.m5stack.com/topic/6083/cores3-http-request-block-urequests-import-error</link><generator>RSS for Node</generator><lastBuildDate>Tue, 17 Mar 2026 13:18:12 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6083.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Feb 2024 02:45:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Fri, 01 Mar 2024 14:45:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/87296">@_andreas_</a> said in <a href="/post/24209">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto">Hi,</p>
<p dir="auto">FYI: I've got a response from m5stack support regarding this issue:</p>
<blockquote>
<p dir="auto">Below issue is caused by the mpy version changing. We may fix it by next version, which should be next Friday. Thx!</p>
</blockquote>
</blockquote>
<p dir="auto">Can confirm, this is now fixed!</p>
]]></description><link>https://community.m5stack.com/post/24217</link><guid isPermaLink="true">https://community.m5stack.com/post/24217</guid><dc:creator><![CDATA[mikeluyten]]></dc:creator><pubDate>Fri, 01 Mar 2024 14:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Fri, 01 Mar 2024 07:06:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">FYI: I've got a response from m5stack support regarding this issue:</p>
<blockquote>
<p dir="auto">Below issue is caused by the mpy version changing. We may fix it by next version, which should be next Friday. Thx!</p>
</blockquote>
]]></description><link>https://community.m5stack.com/post/24209</link><guid isPermaLink="true">https://community.m5stack.com/post/24209</guid><dc:creator><![CDATA[_andreas_]]></dc:creator><pubDate>Fri, 01 Mar 2024 07:06:55 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Mon, 26 Feb 2024 07:46:21 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/87206">@mikeluyten</a> said in <a href="/post/24118">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto">I believe the included "requests" library may be too large for the memory of the S3, and urequests IS the intended library that should be included in the firmware (which it is not)</p>
</blockquote>
<p dir="auto">this is imho not the point of this topic. The problem is, that using the <code>http</code> block in <code>UIFlow 2.0.1</code> leads to an invalid import. The block must be adopted to either import <code>requests</code> instead of <code>urequests</code> or someone has to check, why the <code>urequests</code> wrapper package from Micropython cannot be loaded (which should load <code>requests</code> due to the renaming in Micropython 7 month ago).</p>
<p dir="auto">Until than, <code>http</code> block is not usable without editing the code afterwards (which leads to the fact, that one cannot longer use the UI for programming).</p>
<p dir="auto">For now I've solved it by replacing all <code>http</code> blocks with <code>Execute my python</code> blocks containing these two lines:</p>
<pre><code>http_req = requests.get('http://my.local/url', headers={})
http_req.close()
</code></pre>
<p dir="auto">Since I do not need the response this is even shorter than using the <code>http</code> block.</p>
]]></description><link>https://community.m5stack.com/post/24134</link><guid isPermaLink="true">https://community.m5stack.com/post/24134</guid><dc:creator><![CDATA[_andreas_]]></dc:creator><pubDate>Mon, 26 Feb 2024 07:46:21 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Sun, 25 Feb 2024 03:23:51 GMT]]></title><description><![CDATA[<p dir="auto">urequests is not a typo, the u stands for μ, the Greek symbol for micro. Meaning: "micro"-requests, a smaller version of the requests library, slimmed down for micropython.<br />
I have read that urequests has also now been replaced by urllib.request as a further optimised version for low memory ESP devices.</p>
<p dir="auto">I believe the included "requests" library may be too large for the memory of the S3, and urequests IS the intended library that should be included in the firmware (which it is not)</p>
<p dir="auto">Using requests instead of urequests in my code I get the following error:<br />
File "requests/<strong>init</strong>.py", line 180, in get<br />
File "requests/<strong>init</strong>.py", line 93, in request<br />
OSError: [Errno 12] ENOMEM</p>
]]></description><link>https://community.m5stack.com/post/24118</link><guid isPermaLink="true">https://community.m5stack.com/post/24118</guid><dc:creator><![CDATA[mikeluyten]]></dc:creator><pubDate>Sun, 25 Feb 2024 03:23:51 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 15:33:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/87296">@_andreas_</a> said in <a href="/post/24027">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> said in <a href="/post/24022">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto">Add a execute block and type in the import request function</p>
</blockquote>
<p dir="auto">I'm not sure if I get you right.<br />
I can add the custom import using a execute block.<br />
But this will add a new import line to the bottom of imports and the problematic import <code>import urequests as requests</code> will still exist in the code generated by UIFlow 2.1. Therefore the error persists.</p>
<p dir="auto">Here is a screenshot of what I'm talking about:</p>
<p dir="auto"><img src="/assets/uploads/files/1708603173766-50818acb-4ed1-4ebc-b71a-f2e44a7c30cf-image-resized.png" alt="0_1708603172623_50818acb-4ed1-4ebc-b71a-f2e44a7c30cf-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It's weird anyway, as the Web console states, that MicroPython 1.22 is running, which should contain the Wrapper package <code>urequests</code> anyway.</p>
</blockquote>
<p dir="auto">Sort of but you are actually importing my the library Twice but with different names.  Which in theory will sometimes fix the issue if it can’t find a library with one of the names.</p>
<p dir="auto">It’s a bridge fix if one of the libraries is spelt wrong in the import as we have here</p>
]]></description><link>https://community.m5stack.com/post/24033</link><guid isPermaLink="true">https://community.m5stack.com/post/24033</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 22 Feb 2024 15:33:22 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 14:23:19 GMT]]></title><description><![CDATA[<p dir="auto">This was my original question really.</p>
<p dir="auto">If I add any HTTP block into UiFlow2.x then it will include <strong>import urequests</strong> in the code.</p>
<p dir="auto">This will fail, even if I add an <strong>import requests</strong> myself.</p>
<p dir="auto">So my solution was to use a code block <em>instead</em> of a http block to perform the task I wanted, but a little on the clumsy side and not really what UiFlow was meant to be used.</p>
<p dir="auto">I wonder if I imported reuqests as urequests and then urequests as request it would fool it?</p>
<p dir="auto">Tim</p>
]]></description><link>https://community.m5stack.com/post/24031</link><guid isPermaLink="true">https://community.m5stack.com/post/24031</guid><dc:creator><![CDATA[MadeFL]]></dc:creator><pubDate>Thu, 22 Feb 2024 14:23:19 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 12:02:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/443">@ajb2k3</a> said in <a href="/post/24022">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto">Add a execute block and type in the import request function</p>
</blockquote>
<p dir="auto">I'm not sure if I get you right.<br />
I can add the custom import using a execute block.<br />
But this will add a new import line to the bottom of imports and the problematic import <code>import urequests as requests</code> will still exist in the code generated by UIFlow 2.1. Therefore the error persists.</p>
<p dir="auto">Here is a screenshot of what I'm talking about:</p>
<p dir="auto"><img src="/assets/uploads/files/1708603173766-50818acb-4ed1-4ebc-b71a-f2e44a7c30cf-image-resized.png" alt="0_1708603172623_50818acb-4ed1-4ebc-b71a-f2e44a7c30cf-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It's weird anyway, as the Web console states, that MicroPython 1.22 is running, which should contain the Wrapper package <code>urequests</code> anyway.</p>
]]></description><link>https://community.m5stack.com/post/24027</link><guid isPermaLink="true">https://community.m5stack.com/post/24027</guid><dc:creator><![CDATA[_andreas_]]></dc:creator><pubDate>Thu, 22 Feb 2024 12:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 10:13:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="mention plugin-mentions-user plugin-mentions-a" href="https://community.m5stack.com/uid/87653">@streammyevent</a> said in <a href="/post/23995">CoreS3 &amp; HTTP Request block: urequests import error</a>:</p>
<blockquote>
<p dir="auto">This results in:</p>
<pre><code class="language-python">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 5, in &lt;module&gt;
ImportError: no module named 'urequests'
&gt;&gt;&gt; 
</code></pre>
</blockquote>
<p dir="auto">Sorry that should have been requests not urequests</p>
]]></description><link>https://community.m5stack.com/post/24023</link><guid isPermaLink="true">https://community.m5stack.com/post/24023</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 22 Feb 2024 10:13:10 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 10:12:32 GMT]]></title><description><![CDATA[<p dir="auto">Add a execute block and type in the import request function</p>
]]></description><link>https://community.m5stack.com/post/24022</link><guid isPermaLink="true">https://community.m5stack.com/post/24022</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 22 Feb 2024 10:12:32 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Thu, 22 Feb 2024 06:18:37 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I'm very new and just startet with M5Dial and UIFlow 2.0.1 yesterday.</p>
<p dir="auto">Adding <code>http</code> as Software and a <code>HTTP request</code> block results in this import line:<br />
<code>import urequests as requests</code></p>
<p dir="auto">which leads to the error stated above:<br />
<code>ImportError: no module named 'urequests'</code></p>
<p dir="auto">For me a fix ist to switch the code view to <strong>Custom Edit</strong> and rewrite this line as<br />
<code>import requests</code></p>
<p dir="auto">or<br />
<code>import requests as requests</code></p>
<p dir="auto">Now the code compiles and http requests are working.</p>
<p dir="auto">But for every change in the UI one have to reset the <strong>Custom Edit</strong> and enable it with this change again before doing another <strong>Run</strong>.</p>
<p dir="auto">Looking at <a href="https://github.com/micropython/micropython-lib/tree/master/micropython/urequests" target="_blank" rel="noopener noreferrer nofollow ugc">this</a> it seems that <code>urequests</code> have been renamed to <code>requests</code> 7 month ago. As far as I've read, UIFlow is based on <strong>MicroPython</strong>.</p>
<p dir="auto">They created a wrapper for <code>urequests</code> which would even help in our case:</p>
<blockquote>
<p dir="auto">The MicroPython version of requests was previously called urequests and a lot of existing code depends on being able to still import the module by that name.<br />
This package provides a wrapper to allow this. Prefer to install and use the requests package instead.</p>
</blockquote>
<p dir="auto">Any guess howto add a custom module in UIFlow 2.0 or tell the http block to import <code>requests</code> instead of <code>urequests</code> or update the used version of MIcropython?</p>
<p dir="auto">Kind regards</p>
]]></description><link>https://community.m5stack.com/post/24018</link><guid isPermaLink="true">https://community.m5stack.com/post/24018</guid><dc:creator><![CDATA[_andreas_]]></dc:creator><pubDate>Thu, 22 Feb 2024 06:18:37 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Wed, 21 Feb 2024 17:23:36 GMT]]></title><description><![CDATA[<p dir="auto">Well that's odd</p>
]]></description><link>https://community.m5stack.com/post/23996</link><guid isPermaLink="true">https://community.m5stack.com/post/23996</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 21 Feb 2024 17:23:36 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Wed, 21 Feb 2024 17:16:07 GMT]]></title><description><![CDATA[<p dir="auto">This results in:</p>
<pre><code class="language-python">Traceback (most recent call last):
  File "&lt;stdin&gt;", line 5, in &lt;module&gt;
ImportError: no module named 'urequests'
&gt;&gt;&gt; 
</code></pre>
]]></description><link>https://community.m5stack.com/post/23995</link><guid isPermaLink="true">https://community.m5stack.com/post/23995</guid><dc:creator><![CDATA[streammyevent]]></dc:creator><pubDate>Wed, 21 Feb 2024 17:16:07 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Wed, 21 Feb 2024 13:31:47 GMT]]></title><description><![CDATA[<p dir="auto">I think the issue lies with the fact it’s importing urequests as request   Try adding</p>
<p dir="auto">‘’’ import urequests ‘’’</p>
]]></description><link>https://community.m5stack.com/post/23981</link><guid isPermaLink="true">https://community.m5stack.com/post/23981</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 21 Feb 2024 13:31:47 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Wed, 21 Feb 2024 12:29:52 GMT]]></title><description><![CDATA[<p dir="auto">Same issue here. Also v2.0.1 on a Core2. Putting the WLAN block after the HTTP request also does not help.</p>
]]></description><link>https://community.m5stack.com/post/23977</link><guid isPermaLink="true">https://community.m5stack.com/post/23977</guid><dc:creator><![CDATA[streammyevent]]></dc:creator><pubDate>Wed, 21 Feb 2024 12:29:52 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Tue, 13 Feb 2024 17:19:11 GMT]]></title><description><![CDATA[<p dir="auto">Might sound stupid but put the WLAN block after the http requests.<br />
Also you are missing the update block from the loop.</p>
]]></description><link>https://community.m5stack.com/post/23791</link><guid isPermaLink="true">https://community.m5stack.com/post/23791</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Tue, 13 Feb 2024 17:19:11 GMT</pubDate></item><item><title><![CDATA[Reply to CoreS3 &amp; HTTP Request block: urequests import error on Tue, 13 Feb 2024 12:38:49 GMT]]></title><description><![CDATA[<p dir="auto">Update: Error message in image below.</p>
<p dir="auto"><img src="/assets/uploads/files/1707827732899-screenshot-2024-02-13-at-02.51.42-resized.png" alt="0_1707827727755_Screenshot 2024-02-13 at 02.51.42.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Whilst this got me bugged through the night, I have managed to get something working after REPL-ing into the CoreS3.</p>
<p dir="auto">The library urequests isn't there, but there is one called requests</p>
<p dir="auto">I have adapted my code to run in execute blocks in UiFlow to get a result. It's not the best, but it does work.</p>
<p dir="auto">Below is the same code but trying to use it in something else as part of my testing.<br />
<img src="/assets/uploads/files/1707827919532-screenshot-2024-02-13-at-12.37.04-resized.png" alt="0_1707827918343_Screenshot 2024-02-13 at 12.37.04.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Thanks again.</p>
]]></description><link>https://community.m5stack.com/post/23786</link><guid isPermaLink="true">https://community.m5stack.com/post/23786</guid><dc:creator><![CDATA[MadeFL]]></dc:creator><pubDate>Tue, 13 Feb 2024 12:38:49 GMT</pubDate></item></channel></rss>