Relocatable environment

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
katiequinn
Posts: 1
Joined: Fri Aug 09, 2019 8:47 am

Relocatable environment

Post by katiequinn » Fri Aug 09, 2019 8:51 am

Hello all,
I would like to know how can I create relocatable virtual environment with micropython.
For example through virtualenv.

I tried to create virtual env:
virtualenv -p micropython <my_env>

but I received next error:
Running virtualenv with interpreter /usr/local/bin/micropython
MemoryError: memory allocation failed, allocating 10232 bytes

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

Re: Relocatable environment

Post by jimmo » Fri Aug 09, 2019 11:36 am

You can use the "-X heapsize=" option to increase the heap size, otherwise you can modify the "heap_size" variable at the top of ports/unix/main.c and build the micropython binary yourself.

I tried quickly to test this out but I ran into other issues first using "virtualenv -p micropython" (e.g. os.environ).

Post Reply