Comments (5)
Yes, ENOMEM is "not enough memory", but not on Python side, but on system side. If you look at:
File "upip.py", line 151, in url_open
It is:
s = ussl.wrap_socket(s, server_hostname=host)
I.e., there it creates an SSL socket. That may require allocating quite large buffers, up to 16KB, and that of contiguous memory. I don't use ESP32, so not sure how large buffer(s) are allocated for it. E.g. on ESP8266 buffer specifically set to a low value (4-5K) to increase the chance of successful SSL socket creation (but then amount of data transferred is usually limited to that amount).
>>> gc.mem_free()
63680
That shows amount of total free memory, here the size of the largest contiguous block would be important. A general suggestion for cases like this is "try to run upip immediately after reset, when memory isn't yet fragmented by other operations".
from pycopy-lib.
Thanks for your reply.
My main struggle is that after uploading the regular MicroPython firmware (daily build) Upip works and this error doesn't show up at all.
After uploading the Pycopy firmware immediately after booting it can't install a single package because this error is always there.
Do you have any suggestions on how to figure this out? Could I have made an error compiling the firmware?
from pycopy-lib.
That's indeed a strange and sad situation. Pycopy is somewhat behind the upstream in ESP32-related changes, I'm pulling them in these days, hopefully that might resolve the issue. Otherwise, the main focus of Pycopy is development of language-level features, nor particular hardware platforms, I treat Unix port as the reference platform.
So, trying to reproduce the issue with Unix port would be the way to tell whether it's regression in Pycopy/upip, or "hardware-specific" issue with ESP32. Note that it's easy to mimic a small heap condition on Unix port, see pycopy --help
.
A quick test shows that following works:
pycopy -X heapsize=8wK -m upip install -p . picoweb
(For cleanness of experiment, would of course need to build 32-bit unix version, the above is with default-nowadays 64-bit.)
from pycopy-lib.
Looks like that's it: pfalcon/pycopy@cbf14fd
from pycopy-lib.
Confirmed, it is working perfectly now. Can this be closed?
MicroPython v2.11.0.16-179-g979ec245b on 2019-12-06; ESP32 module with ESP32
Type "help()" for more information.
>>>
>>> import upip
>>> upip.install('picoweb')
Installing to: /lib/
Warning: pypi.org SSL certificate is not validated
Installing picoweb from https://files.pythonhosted.org/packages/27/47/5d70d23ecc778bff5fdae3ef2eb57d59aff4a260da1b90
from pycopy-lib.
Related Issues (20)
- Add basic comment spec to uyaml HOT 1
- ubinascii HOT 1
- urequest module error when calling a HTTPS url HOT 1
- 'pip install micropython-upip' returned error HOT 1
- Micropython v1.17 SHA1 HOT 3
- OSError: -40
- Feature: Allow upip to install from test.pypi.org HOT 1
- logging module: AttributeError: 'FileIO' object has no attribute 'flush' micropython 1.18 HOT 1
- Uasyncio equivalent for `asyncio.gather`/`asyncio.wait`? HOT 1
- ImportError: no module named 'uasyncio.websocket'
- Unable to install pycopy-xmltok2 using pip or manual install
- error on socket.py
- AttributeError: 'module' object has no attribute 'SSLContext' HOT 1
- Urequests error while sending HTTPS requests.
- logging error on lineno formater HOT 1
- logging stuck not there for us
- [logging] The Micropython Logging package implementation is not thread safe
- [logging.RotatingFileHandler] The RotatingFileHandler opens and closes file for each message
- [logging.RotatingFileHandler] The rotation logic doesn't take into account initial log file size. HOT 1
- [logging] sys.exc_info() function doesn't exist on ESP32 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycopy-lib.