I have been trying to upload ulab in firmware. I have used this bin fileESP32/v1.12_with_ulab/ulab_v0.54.0_2020 ... -07-29.bin. I get this burn into my esp32 and see Ulab is in the boot. The following are the function in ulab. encode -- <function>
find -- <function>
rfind -- <function>
index -- <function>
rindex -- <function>
join -- <function>
split -- <function>
splitlines -- <function>
rsplit -- <function>
startswith -- <function>
endswith -- <function>
strip -- <function>
lstrip -- <function>
rstrip -- <function>
format -- <function>
replace -- <function>
count -- <function>
partition -- <function>
rpartition -- <function>
center -- <function>
lower -- <function>
upper -- <function>
isspace -- <function>
isalpha -- <function>
isdigit -- <function>
isupper -- <function>
islower -- <function>
error code ImportError: no module named 'numpy'
I am running version download ok
exec(open('ulab.py').read(),globals())
you are running ulab version 0.54.0
What pray tell am I doing wrong? Where is the numpy?
Ulab Problems
Re: Ulab Problems
I'm guessing this comes from heresprinkfitter wrote: ↑Tue Jan 19, 2021 1:02 amI have used this bin fileESP32/v1.12_with_ulab/ulab_v0.54.0_2020 ... -07-29.bin.
https://gitlab.com/rcolistete/micropyth ... 2020-07-29
I think you might be using the help() function incorrectly as it's printing out the methods on str. Can you show us how you're using help?
It should be
Code: Select all
>>> import ulab
>>> help(ulab)
ulab isn't numpy, it just provides something that looks a bit like numpy. So you need to import ulab instead.
See this example for how to make code that works with both numpy and ulab:
https://github.com/v923z/micropython-ulab#usage
-
- Posts: 36
- Joined: Wed Sep 27, 2017 1:42 pm
- Location: Louisville Ky
Re: Ulab Problems
Thank you for your responds. Made newbie mistake. object <module 'ulab'> is of type module
__name__ -- ulab
__version__ -- 0.54.0
set_printoptions -- <function>
get_printoptions -- <function>
array -- <class 'ndarray'>
arange -- <function>
eye -- <function>
linspace -- <function>
ones -- <function>
zeros -- <function>
linalg -- <module 'linalg'>
vector -- <module 'vector'>
numerical -- <module 'numerical'>
poly -- <module 'poly'>
fft -- <module 'fft'>
filter -- <module 'filter'>
compare -- <module 'compare'>
approx -- <module 'approx'>
user -- <module 'user'>
uint8 -- 66
int8 -- 98
uint16 -- 72
int16 -- 104
float -- 100
When I run this I still get the error download ok
exec(open('testnumpy.py').read(),globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 5, in <module>
ImportError: no module named 'numpy'
Is there a bin file that would have all of ulab including numpy and scipy?
__name__ -- ulab
__version__ -- 0.54.0
set_printoptions -- <function>
get_printoptions -- <function>
array -- <class 'ndarray'>
arange -- <function>
eye -- <function>
linspace -- <function>
ones -- <function>
zeros -- <function>
linalg -- <module 'linalg'>
vector -- <module 'vector'>
numerical -- <module 'numerical'>
poly -- <module 'poly'>
fft -- <module 'fft'>
filter -- <module 'filter'>
compare -- <module 'compare'>
approx -- <module 'approx'>
user -- <module 'user'>
uint8 -- 66
int8 -- 98
uint16 -- 72
int16 -- 104
float -- 100
Code: Select all
try:
from ulab import numpy as np
from ulab import scipy as spy
except ImportError:
import numpy as np
import scipy as spy
x = np.array([1, 2, 3])
spy.special.erf(x)
exec(open('testnumpy.py').read(),globals())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 5, in <module>
ImportError: no module named 'numpy'
Is there a bin file that would have all of ulab including numpy and scipy?
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: Ulab Problems
Follow ulab docs.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
-
- Posts: 36
- Joined: Wed Sep 27, 2017 1:42 pm
- Location: Louisville Ky
Re: Ulab Problems
Thank You for your insight on Ulab. I have read the docs and have not found the bin file with Numpy in it. Fairly new to Micropython would hope I could get a little bit more help. Even the new guy always looks at the docs. When they do not see something they ask a question. I know it must be in front of my eyes. With Covid in the states my eyes could be going bad.
Thanks
Thanks
Re: Ulab Problems
There is no numpy for MicroPython, only ulab.sprinkfitter wrote: ↑Thu Jan 21, 2021 7:03 pmI have read the docs and have not found the bin file with Numpy in it.
The maintainers of ulab don't provide a ESP32 build (only instructions on how to make it yourself -- https://github.com/v923z/micropython-ul ... sed-boards)
However rcolistete provides a pre-built bin for ESP32 (and other boards) at https://gitlab.com/rcolistete/micropyth ... _with_ulab