Comments (7)
ImportError: can't import name preprocess
this will be the same thing as util.py
- the file did not get installed correctly.
Basically the mip install crashed while downloading preprocess.py
so it and all files thereafter are corrupt/missing. You can see the full list of files that should have downloaded in the gist: (one more file that should have come after the mip crash during preprocess.py
).
Make sure to manually copy all the missing files to the esp32_ulp
directory on your ESP32.
from micropython-esp32-ulp.
Thanks for the report. It's definitely something that needs to be fixed.
I'm working on that one (should have it soon), but currently focusing on finishing S2/S3 support.
For now you could use mpremote
on a PC to copy the necessary files to your ESP32.
First clone this repo, then from within the repo root, run:
pip install mpremote #if not yet installed
mpremote cp -r esp32_ulp :
Then it will work.
from micropython-esp32-ulp.
Potentially this would work too (I havent tested it, but I made the necessary package.json available as a Gist):
# on the ESP32
# make sure network is connected
import mip
mip.install("https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json")
from micropython-esp32-ulp.
Potentially this would work too (I havent tested it, but I made the necessary package.json available as a Gist):
# on the ESP32 # make sure network is connected import mip mip.install("https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json")
Wow thanks for the fast reply!
Your command almost worked:
>>> import mip
>>> mip.install("https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json")
Installing https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json to /lib
Copying: /lib/esp32_ulp/__init__.py
Copying: /lib/esp32_ulp/__main__.py
Copying: /lib/esp32_ulp/assemble.py
Copying: /lib/esp32_ulp/definesdb.py
Copying: /lib/esp32_ulp/link.py
Copying: /lib/esp32_ulp/nocomment.py
Copying: /lib/esp32_ulp/opcodes.py
Copying: /lib/esp32_ulp/parse_to_db.py
Copying: /lib/esp32_ulp/preprocess.py
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mip/__init__.py", line 1, in install
File "mip/__init__.py", line 1, in _install_package
File "mip/__init__.py", line 1, in _install_json
File "mip/__init__.py", line 1, in _download_file
File "mip/__init__.py", line 1, in _chunk
OSError: -29184
>>>
from micropython-esp32-ulp.
Potentially this would work too (I havent tested it, but I made the necessary package.json available as a Gist):
# on the ESP32 # make sure network is connected import mip mip.install("https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json")Wow thanks for the fast reply!
Your command almost worked:>>> import mip >>> mip.install("https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json") Installing https://gist.githubusercontent.com/wnienhaus/5a30dd2ac7000764b065b44c5341f1e9/raw/54e1d43dbb0761b10134a34ca70d272064b66987/package.json to /lib Copying: /lib/esp32_ulp/__init__.py Copying: /lib/esp32_ulp/__main__.py Copying: /lib/esp32_ulp/assemble.py Copying: /lib/esp32_ulp/definesdb.py Copying: /lib/esp32_ulp/link.py Copying: /lib/esp32_ulp/nocomment.py Copying: /lib/esp32_ulp/opcodes.py Copying: /lib/esp32_ulp/parse_to_db.py Copying: /lib/esp32_ulp/preprocess.py Traceback (most recent call last): File "<stdin>", line 1, in <module> File "mip/__init__.py", line 1, in install File "mip/__init__.py", line 1, in _install_package File "mip/__init__.py", line 1, in _install_json File "mip/__init__.py", line 1, in _download_file File "mip/__init__.py", line 1, in _chunk OSError: -29184 >>>
Further after ignoring the oserror, and copying the example file counter.py, I got this:
>>> import counter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "counter.py", line 15, in <module>
File "/lib/esp32_ulp/__init__.py", line 1, in <module>
ImportError: no module named 'esp32_ulp.util'
I had to copy over util.py, which then results in:
>>> import counter
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "counter.py", line 15, in <module>
File "/lib/esp32_ulp/__init__.py", line 3, in <module>
ImportError: can't import name preprocess
>>>
from micropython-esp32-ulp.
ImportError: can't import name preprocessthis will be the same thing as
util.py
- the file did not get installed correctly.Basically the mip install crashed while downloading
preprocess.py
so it and all files thereafter are corrupt/missing. You can see the full list of files that should have downloaded in the gist: (one more file that should have come after the mip crash duringpreprocess.py
).Make sure to manually copy all the missing files to the
esp32_ulp
directory on your ESP32.
This was exactly the problem thanks a bunch!
from micropython-esp32-ulp.
I'll reopen this, because one still cannot install using mip, and the latest MicroPython no longer has upip. (The above is just a workaround).
I'll add the necessary support next, by adding a valid package.json
file and by updating the documentation.
from micropython-esp32-ulp.
Related Issues (20)
- github + pypi setup > docs?
- "how to release" docs
- Can't get it to run HOT 16
- Thank you so much for great lib, I cannot figure out I2C RD/WR. HOT 8
- LED is not blinking HOT 3
- Still Struggling HOT 37
- Bug: Upper case expressions not supported
- memory problem HOT 3
- Requesting a WAKE example HOT 12
- Request for Clarification of ULP GPIO example HOT 1
- Questiona about GPIO Output (LED) example HOT 3
- Update Actions runner image HOT 1
- Fix build
- Decide how to follow the latest MicroPython HOT 2
- Support ESP32-S2 HOT 8
- ulp rtc clock calibration HOT 2
- Add License/Copyright to all files HOT 7
- interrupt from RTC GPIO
- Release 1.3.0
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 micropython-esp32-ulp.