hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Installing MicroPython - How To Guide

Fri Aug 25, 2017 9:21 pm

Updated : 07 July 2019

The following instructions detail how to install MicroPython on a Pi. Previously tested and working with Raspbian Stretch on a Pi Zero W and Pi 3B so should work on any Pi variant. Latest successful build was tested with a Pi 3B running Buster on 7th July 2019.

Note that this is a version of MicroPython which runs similarly to how Python 2.7 and Python 3.x run on the Pi. It is an application which runs under Raspbian and is not a bootable MicroPython which replaces Raspbian or other OS.

MicroPython will not be of interest to most Pi users who should continue to use Python 2.7 or Python 3.x as usual. It can however be useful when making benchmark comparisons with other Python versions and is an ideal starting point for any Pi user interested in programming with MicroPython or developing it further, for the Pi or other platform.

1) Installing development tools

The first two may already be installed by default with Raspbian but the 'libffi-dev' will likely not be -

Code: Select all

sudo apt-get install git
sudo apt-get install build-essential
sudo apt-get install libffi-dev
2) Getting the MicroPython source

Code: Select all

cd ~
git clone https://github.com/micropython/micropython.git
This will have created a 'micropython' sub-directory in your 'pi' home directory.

If you have previously installed MicroPython using 'git clone' you can bring it up to date using -

Code: Select all

cd ~
cd micropython
git pull
Then continue with the instructions below as if building for the first time.

3) Building MicroPython for the Pi

Code: Select all

cd ~
cd micropython
cd ports                                   See notes below
cd unix
make clean
make axtls

Code: Select all

cd ~
cd micropython
cd mpy-cross                               See notes below
make

Code: Select all

cd ~
cd micropython
cd ports
cd unix
make
Note that 'make axtls' and 'make' may generate warnings which can (probably) be ignored. The 'make axtls' takes about 5 minutes on a Pi Zero W, 'make' less than 10 minutes.

Note the November 2017 release moved all ports of MicroPython into a 'ports' sub-directory. When MicroPython is built the executable will be placed in the '~/micropython/ports/unix' directory.

Note that latest releases require the 'mpy-cross' utility to be built before a 'make' will be successful. If getting a "../../mpy-cross/mpy-cross: Command not found" error 'mpy-cross' most likely needs building. This takes just a few minutes.

4) Testing the MicroPython build

Run the MicroPython executable with -

Code: Select all

./micropython
This should show something like -

Code: Select all

MicroPython v1.11-126-g7c2e83324 on 2019-07-07; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>>
Enter the following a line at a time, pressing return at the end of each line to execute that line -

Code: Select all

print("Hello World!")
import uos
print(dir(uos))
Use Ctrl-D to exit to the Raspbian command prompt.

To run the MicorPython test suite just to confirm everything is how it should be -

Code: Select all

cd ~
cd micropython
cd ports
cd unix
make test
The tests should only take a couple of minutes to complete.

This should also show the same results -

Code: Select all

cd ~
cd micropython
cd tests
./run-tests
5) Installing micropython-lib packages

MicroPython has a limited number of packages pre-installed with limited functionality. Most pre-installed package names are prefixed by a 'u', for example 'usocket' for MicroPython where it would normally be 'socket' for Python 2.7 and Python 3.x.

The micropython-lib project aims to provide more complete packages for MicroPython. A list of available micropython-lib packages is available at -

https://pypi.python.org/pypi?:action=se ... icropython

Note that not all packages are complete and not all functionality of the Python 2.7 or Python 3.x packages they aim to be equivalent to may be available.

Packages can be installed using -

Code: Select all

./micropython -m upip install <micropython-package>
Where <micropython-package> should be replaced by the name of the package to install.

For example to include the 'socket' package which is more comprehensive than the pre-installed 'usocket' package, use -

Code: Select all

./micropython -m upip install micropython-socket
Note that if the 'micropython-' prefix is not specified for the package name then 'upip' may install an incorrect or earlier version of the desired package.

Once a package has been installed it can then be specified using an 'import' as usual within your MicroPython program -

Code: Select all

./micropython

Code: Select all

import usocket
print(dir(usocket))

Code: Select all

import socket
print(dir(socket))
6) Making MicroPython available everywhere

When MicroPython is built its executable will be created in the '~/micropython/ports/unix' directory. This means you need to be in that directory to run './micropython' or need to specify the executable's full path to run it from somewhere else. This is not always desirable nor convenient.

To make MicroPython available everywhere, and to allow it to be invoked using 'micropython', a symbolic link may be created as follows -

Code: Select all

sudo ln -s ~/micropython/ports/unix/micropython /usr/local/bin/micropython
This may not be the best or most appropriate way to do things but does generally work.

This is a 'quick and dirty' way to make MicroPython available everywhere or have it temporarily available everywhere while investigating other ways to achieve the same which may better suit your own situation.

To remove the symbolic link if you created it and want that gone or you choose to make MicroPython available everywhere some other way -

Code: Select all

sudo rm /usr/local/bin/micropython
Edit History

25 Aug 2017 - Original How To
26 Dec 2017 - Updated for 'ports' sub-directory
27 Dec 2017 - Clarified 'micropython-' prefix for package names
27 Dec 2017 - Added link for MicroPython Community Forum
17 Feb 2018 - Added making MicroPython available everywhere
03 Oct 2018 - Added how to keep MicroPython up to date
03 Oct 2018 - Added how to run the MicroPython test suite
03 May 2019 - Confirmed build instructions worked for me on a Pi 3B Stretch
05 May 2019 - Added link for MicroPython Bug Reports and Issues
07 Jul 2019 - Added building of mpy-cross step
07 Jul 2019 - Updated testing step
07 Jul 2019 - Updated symlink of MicroPython to be in /usr/local/bin
07 Jul 2019 - Confirmed build instructions worked for me on a Pi 3B Buster

Links - MicroPython

Home Page : https://micropython.org
Documentation : http://docs.micropython.org
Source Code : https://github.com/micropython/micropython
Release Notes : https://github.com/micropython/micropython/releases
Bug Reports : https://github.com/micropython/micropython/issues
Community Forum : https://forum.micropython.org

Links - MicroPython Packages (micropython-lib)

Packages List : https://pypi.python.org/pypi?:action=se ... icropython
Information : https://github.com/micropython/micropython-lib
Last edited by hippy on Sun Jul 07, 2019 4:01 pm, edited 19 times in total.

BoKKeR
Posts: 6
Joined: Wed Nov 20, 2013 9:14 pm

Re: Installing MicroPython - How To Guide

Sun Dec 24, 2017 8:10 pm

would this allow me to develop scripts that I can later move to a esp8266 for example? is there some limitations like i2c not working etc? if not this would make me really happy

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Mon Dec 25, 2017 12:38 pm

BoKKeR wrote:
Sun Dec 24, 2017 8:10 pm
would this allow me to develop scripts that I can later move to a esp8266 for example? is there some limitations like i2c not working etc? if not this would make me really happy
The instructions above create the generic 'unix' version of MicroPython on a Pi. Physical hardware interfacing would done be through imported modules. You might have to create those yourself; those can be real modules which work or skeleton modules which just provide for testing code.

The easiest way to find out is probably to try it.

Glasairman
Posts: 12
Joined: Fri Mar 16, 2012 9:55 am
Location: Munich, Germany

Re: Installing MicroPython - How To Guide

Tue Dec 26, 2017 11:30 am

My install on a Pi Zero failed at the step cd unix as the subfolder of ~/micropython was not created during the installation as expected and therefore make clean was not possible, even though I created the folder manually. Any tips from anyone?

3) Building MicroPython for the Pi

Code: Select all

cd micropython
cd unix
make clean
make axtls
make

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Tue Dec 26, 2017 12:11 pm

Glasairman wrote:
Tue Dec 26, 2017 11:30 am
My install on a Pi Zero failed at the step cd unix as the subfolder of ~/micropython was not created during the installation as expected
Looking at https://github.com/micropython/micropython/releases it appears they have recently moved the various ports to a "ports" directory. Try a cd ports before a cd unix.

I am not sure in which directory the MicroPython executable will get placed in. When I have a Pi available I will set about getting and testing the latest version and updating the earlier instructions.

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Tue Dec 26, 2017 1:03 pm

hippy wrote:
Tue Dec 26, 2017 12:11 pm
Try a cd ports before a cd unix.
That appears to be the solution. I have updated the instructions in the first post.

When I tried to compile after updating my original cloned version I got a compilation error. Deleting the entire '~/micropython' directory and sub-directories, following the updated installation and build instructions worked for me on a Pi 3B.

BoKKeR
Posts: 6
Joined: Wed Nov 20, 2013 9:14 pm

Re: Installing MicroPython - How To Guide

Wed Dec 27, 2017 1:08 pm

I got it to work but with upip all the packages seem outdated. I looked at ureqests and its on 1.2 instead of 5.2 as opposed to the esp8266 urequest original build. is this something that can be copied over or are the packages developed separately

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Wed Dec 27, 2017 2:44 pm

BoKKeR wrote:
Wed Dec 27, 2017 1:08 pm
I got it to work but with upip all the packages seem outdated. I looked at ureqests and its on 1.2 instead of 5.2 as opposed to the esp8266 urequest original build. is this something that can be copied over or are the packages developed separately.
The issue may be how you are installing packages.

With 'install urequests' that appears to get version 0.1.2 -

Code: Select all

[email protected]:~/micropython/ports/unix$ ./micropython -m upip install urequests
Installing to: /home/pi/.micropython/lib/
Warning: pypi.python.org SSL certificate is not validated
Installing urequests 0.1.2 from https://pypi.python.org/packages/3d/c3/211eeedd2bf6b7be8781b2ad9153f18b848ad50612b778bcab59d30d4a63/urequests-0.1.2.tar.gz
With 'install micropython-urequests' that appears to get version 0.5.1 -

Code: Select all

[email protected]:~/micropython/ports/unix$ ./micropython -m upip install micropython-urequests
Installing to: /home/pi/.micropython/lib/
Warning: pypi.python.org SSL certificate is not validated
Installing micropython-urequests 0.5.1 from https://pypi.python.org/packages/a6/8a/d6656982387259da74965a04ae55bde4651a64aa1772cee91bed0a3eebab/micropython-urequests-0.5.1.tar.gz
That 0.5.1 seems to be the latest version on PyPi ...

https://pypi.python.org/pypi?:action=se ... icropython
https://pypi.python.org/pypi/micropython-urequests

Members of the MicroPython community may be able to provide additional help or guidance. I'll add a link to the MicroPython Forum in the initial post -

https://forum.micropython.org

BoKKeR
Posts: 6
Joined: Wed Nov 20, 2013 9:14 pm

Re: Installing MicroPython - How To Guide

Wed Dec 27, 2017 10:28 pm

Thanks that worked great.

User avatar
HermannSW
Posts: 1502
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Installing MicroPython - How To Guide

Wed Oct 03, 2018 1:11 am

Thanks, the instructions worked, and build times on Pi 3B+ are 0:57min/2:37min instead of 5min/10min.

I was happy with MicroPython on ESP32 and ESP01s sofar.
I did build on Raspberry in order to be able to run the test suite (in 1:23min):

Code: Select all

[email protected]pi3BplusX:~/micropython/tests $ time ( ./run-tests )
...
pass  unicode/unicode_subscr.py
skip  unix/extra_coverage.py
pass  unix/ffi_callback.py
pass  unix/ffi_float.py
pass  unix/ffi_float2.py
660 tests performed (19011 individual testcases)
660 tests passed
62 tests skipped: builtin_help builtin_range_binop class_delattr_setattr io_buffered_writer namedtuple_asdict sys_getsizeof cmd_parsetree framebuf1 framebuf16 framebuf2 framebuf4 framebuf8 framebuf_subclass urandom_extra urandom_extra_float ure_groups ure_span ure_sub ure_sub_unmatched vfs_basic vfs_fat_fileio1 vfs_fat_fileio2 vfs_fat_more vfs_fat_oldproto vfs_fat_ramdisk vfs_userfs math_factorial_intbig mpy_invalid resource_stream native_closure native_const native_const_intbig native_misc native_try native_try_deep native_with schedule viper_addr viper_args viper_binop_arith viper_binop_comp viper_binop_comp_imm viper_binop_divmod viper_binop_multi_comp viper_cond viper_const viper_const_intbig viper_error viper_globals viper_import viper_misc viper_misc_intbig viper_ptr16_load viper_ptr16_store viper_ptr32_load viper_ptr32_store viper_ptr8_load viper_ptr8_store viper_subscr viper_try viper_with extra_coverage

real	1m23.021s
user	1m12.078s
sys	0m10.239s
[email protected]:~/micropython/tests $

Then I did run the tests against ESP32 module (that was what I really was interested in).
Slower, in 7:40min, and with 23 testcase failures:

Code: Select all

[email protected]:~/micropython/tests $ time ( ./run-tests --target esp32 --device /dev/ttyUSB0 --baudrate 115200 )
...
pass  misc/features.py
FAIL  misc/non_compliant.py
pass  misc/non_compliant_lexer.py
pass  misc/print_exception.py
pass  misc/rge_sm.py
skip  misc/sys_exc_info.py
588 tests performed (15933 individual testcases)
565 tests passed
66 tests skipped: builtin_range_binop class_delattr_setattr class_descriptor class_reverse_op exception_chain generator_name io_iobase namedtuple_asdict subclass_native_call sys_getsizeof machine_pinbase machine_pulse machine_signal ucryptolib_aes128_cbc ucryptolib_aes128_ecb ucryptolib_aes128_ecb_enc ucryptolib_aes128_ecb_inpl ucryptolib_aes128_ecb_into ucryptolib_aes256_cbc ucryptolib_aes256_ecb uhashlib_md5 ujson_dump_iobase ure_groups ure_span ure_sub ure_sub_unmatched vfs_userfs float2int_doubleprec_intbig float_divmod float_parse_doubleprec math_factorial_intbig heapalloc_bytesio2 meminfo memstats native_closure native_const native_const_intbig native_misc native_try native_try_deep native_with viper_addr viper_args viper_binop_arith viper_binop_comp viper_binop_comp_imm viper_binop_divmod viper_binop_multi_comp viper_cond viper_const viper_const_intbig viper_error viper_globals viper_import viper_misc viper_misc_intbig viper_ptr16_load viper_ptr16_store viper_ptr32_load viper_ptr32_store viper_ptr8_load viper_ptr8_store viper_subscr viper_try viper_with sys_exc_info
23 tests failed: async_with_break async_with_return builtin_round_int builtin_round_intbig builtin_type bytearray_construct class_staticclassmethod class_super gen_yield_from_executing gen_yield_from_throw2 generator_pep479 python36 try_finally_return3 ujson_dump ussl_basic vfs_fat_fileio1 builtin_float_abs float_parse math_domain_special math_fun_special python36 opt_level non_compliant

real	7m40.049s
user	1m55.984s
sys	0m13.652s
[email protected]:~/micropython/tests $

This is MicroPython version on ESP32:

Code: Select all

$ webrepl_client.py 192.168.4.1
Password: 

WebREPL connected
>>> 
>>> 
MicroPython v1.9.4 on 2018-05-11; ESP32 module with ESP32
Type "help()" for more information.
>>> 
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Wed Oct 03, 2018 9:59 am

HermannSW wrote:
Wed Oct 03, 2018 1:11 am
Then I did run the tests against ESP32 module (that was what I really was interested in).
Slower, in 7:40min, and with 23 testcase failures:
I am afraid I cannot really help with that as it appears one needs to have a PyBoard or something compatible to run the tests and I don't have any of those.

The best place to seek help on the ESP32 test issue might be from the MicroPython community - https://forum.micropython.org

Many thanks for the details on how to run the test suite. I have updated my original post to include that and how to keep the MicroPython source up to date.

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Tue Apr 16, 2019 11:46 pm

Given the interests in Fibonacci(24) benchmarking elsewhere in the forum I thought I would benchmark MicroPython. All done on Pi 3B (non-plus) on Raspbian Stretch.

Code: Select all

def Fibonacci(n):
  if n <= 1 : return n
  else      : return Fibonacci(n-1) + Fibonacci(n-2)

print(Fibonacci(24))

Code: Select all

        3.5.3     2.7.13    MicroPython v1.10-278

real    0m0.399s  0m0.290s  0m0.217s
user    0m0.397s  0m0.289s  0m0.217s
sys     0m0.001s  0m0.000s  0m0.000s
Python 3.5 takes 84% longer than MicroPython, 38% longer than Python 2.7
Python 2.7 takes 34% longer than MicroPython

User avatar
Gavinmc42
Posts: 3740
Joined: Wed Aug 28, 2013 3:31 am

Re: Installing MicroPython - How To Guide

Wed Apr 17, 2019 3:47 am

Wonder how fast Micropython on baremetal Pi will go?
Hmm, Pyro and Micropython?

PyPy benchmark?
CPython?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Fri Apr 19, 2019 10:34 pm

And an optimised faster Fibonacci(24) routine

Code: Select all

fiboA = 0
fiboB = 0
def Fast_Fibonacci(n):
  global fiboA
  global fiboB
  if n:
    Fast_Fibonacci(n >> 1)
    if n & 1:
      t = fiboA + fiboA + fiboB
      fiboA *= t
      fiboB *= t
      if (n & 3) == 1 : fiboA += 1
      else            : fiboA -= 1
    else:
      t = fiboB + fiboB - fiboA
      fiboA *= t
      fiboB *= t
      if n & 3 : fiboB += 1
      else     : fiboB -= 1
  else:
    fiboA = 0
    fiboB = 1
  return fiboA

print( Fast_Fibonacci(24) )

Code: Select all

        3.5.3     2.7.13    MicroPython v1.10-278

real    0m0.196s  0m0.079s  0m0.009s
user    0m0.186s  0m0.060s  0m0.001s
sys     0m0.010s  0m0.020s  0m0.008s
Python 3.5 takes 2100% longer than MicroPython, 150% longer than Python 2.7
Python 2.7 takes 870% longer than MicroPython

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Mon Apr 29, 2019 7:20 pm

Gavinmc42 wrote:
Wed Apr 17, 2019 3:47 am
Wonder how fast Micropython on baremetal Pi will go?
That was a bit of a PITA to determine. MicroPython, though based on 3.4, isn't exactly the same as a traditional desktop Python, and that's the main reason I don't really like MicroPython.

Bare Metal MicroPython time.time() only delivers an integer resolution of seconds. It also has to be "import utime as time" for Unix MicroPython, though that does return better than whole seconds resolution.

The best solution seemed to be run a fibo(24) calculation a million times -

Code: Select all

import time

fiboA = 0
fiboB = 0
def Fast_Fibonacci(n):
  global fiboA
  global fiboB
  if n:
    Fast_Fibonacci(n >> 1)
    if n & 1:
      t = fiboA + fiboA + fiboB
      fiboA *= t
      fiboB *= t
      if (n & 3) == 1 : fiboA += 1
      else            : fiboA -= 1
    else:
      t = fiboB + fiboB - fiboA
      fiboA *= t
      fiboB *= t
      if n & 3 : fiboB += 1
      else     : fiboB -= 1
  else:
    fiboA = 0
    fiboB = 1
  return fiboA

startTime = time.time()
for count in range(0,1000000):
  n = Fast_Fibonacci(24)
print(n)
print(time.time()-startTime)
And, time in seconds -

Code: Select all

Pi 3B  : python 3.5.3                 29.223081588745117
Pi 3B  : Python 2.7.13                23.8396651745
Pi 3B  : Unix MicroPython v1.10-278   22.70570516586304
Zero W : Bare Metal MicroPython      682             execfile("mp.py")
Zero W : Bare Metal MicroPython      531             import mp
We are not entirely comparing like with like there, but I don't think the Zero W should be 30 times slower than a Pi 3B. Maybe 10 times slower, which is what I was expecting. So I guess it may come down to the current bare metal implementation. I must admit that, after 10 minutes, I did think it had crashed and simply hung.

And I'm not sure why it's 30% slower when using execfile() rather than when imported.

Of course, implement Fibo(n) as a C extension and it should be as fast as the native C would be.

zazinio
Posts: 4
Joined: Fri May 03, 2019 5:35 pm

Re: Installing MicroPython - How To Guide

Fri May 03, 2019 8:31 pm

HI
iam student and just began to self learn razbian nad python.
i am trying to to install micropython for one project but when get to step 3:

Code: Select all

cd ~
cd micropython
cd ports                                  
cd unix
make clean
make axtls
make
"make axtls" gives:

Code: Select all

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
make: Nothing to be done for 'axtls'.
Don't know is it a problem.
And "make" start to compile but crash with error on mpy-cross

Code: Select all

make[1]: Entering directory '/home/pi/micropython/mpy-cross'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
GEN build/genhdr/qstrdefs.collected.h
QSTR not updated
LINK mpy-cross
collect2: fatal error: ld terminated with signal 11 [Нарушение на разделянето(segfault)]
compilation terminated.
../py/mkrules.mk:132: recipe for target 'mpy-cross' failed
make[1]: *** [mpy-cross] Error 1
make[1]: *** Deleting file 'mpy-cross'
make[1]: Leaving directory '/home/pi/micropython/mpy-cross'
../../py/mkrules.mk:108: recipe for target '../../mpy-cross/mpy-cross' failed
make: *** [../../mpy-cross/mpy-cross] Error 2
i think that mpy-cross is the problem and try :
cd ~/micropython
make -C mpy-cross
gives same error
help find solution

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Fri May 03, 2019 10:22 pm

Not having to do anything for axtls may suggest you have done something earlier which built that. I get the same 'nothing to be done' report except compilation continues without.

I followed my original instructions, cloned from the .git, and that all worked for me on my Pi 3B ...

Code: Select all

[email protected]:~ $ git clone https://github.com/micropython/micropython.git
Cloning into 'micropython'...
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 69980 (delta 17), reused 18 (delta 12), pack-reused 69940
Receiving objects: 100% (69980/69980), 39.39 MiB | 8.79 MiB/s, done.
Resolving deltas: 100% (50525/50525), done.
[email protected]:~ $ cd micropython
[email protected]:~/micropython $ git pull
Already up-to-date.
[email protected]:~/micropython $ cd ports
[email protected]:~/micropython/ports $ cd unix
[email protected]:~/micropython/ports/unix $ make clean
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
rm -f micropython
rm -f micropython.map
rm -rf build 
[email protected]:~/micropython/ports/unix $ make axtls
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
You cloned without --recursive, fetching submodules for you.
(cd ../..; git submodule update --init --recursive)
Submodule 'lib/axtls' (https://github.com/pfalcon/axtls) registered for path 'lib/axtls'
Submodule 'lib/berkeley-db-1.xx' (https://github.com/pfalcon/berkeley-db-1.xx) registered for path 'lib/berkeley-db-1.xx'
Submodule 'lib/libffi' (https://github.com/atgreen/libffi) registered for path 'lib/libffi'
Submodule 'lib/lwip' (https://git.savannah.gnu.org/r/lwip.git) registered for path 'lib/lwip'
Submodule 'lib/nrfx' (https://github.com/NordicSemiconductor/nrfx.git) registered for path 'lib/nrfx'
Submodule 'lib/stm32lib' (https://github.com/micropython/stm32lib) registered for path 'lib/stm32lib'
Cloning into '/home/pi/micropython/lib/axtls'...
Cloning into '/home/pi/micropython/lib/berkeley-db-1.xx'...
Cloning into '/home/pi/micropython/lib/libffi'...
Cloning into '/home/pi/micropython/lib/lwip'...
Cloning into '/home/pi/micropython/lib/nrfx'...
Cloning into '/home/pi/micropython/lib/stm32lib'...
Submodule path 'lib/axtls': checked out '43a6e6bd3bbc03dc501e16b89fba0ef042ed3ea0'
Submodule path 'lib/berkeley-db-1.xx': checked out '35aaec4418ad78628a3b935885dd189d41ce779b'
Submodule path 'lib/libffi': checked out 'e9de7e35f2339598b16cbb375f9992643ed81209'
Submodule path 'lib/lwip': checked out '92f23d6ca0971a32f2085b9480e738d34174417b'
Submodule path 'lib/nrfx': checked out 'd4ebe15f58de1442e3eed93b40d13930e7785903'
Submodule path 'lib/stm32lib': checked out 'a5e93de18479879dd129cf6272cfd75e0c794bd4'
[email protected]:~/micropython/ports/unix $ make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/build/
mkdir -p build/extmod/
mkdir -p build/lib/axtls/crypto/
mkdir -p build/lib/axtls/ssl/
mkdir -p build/lib/berkeley-db-1.xx/btree/
mkdir -p build/lib/berkeley-db-1.xx/mpool/
mkdir -p build/lib/embed/
mkdir -p build/lib/mp-readline/
mkdir -p build/lib/oofatfs/
mkdir -p build/lib/timeutils/
mkdir -p build/lib/utils/
mkdir -p build/py/
CC ../../py/mpstate.c
CC ../../py/nlr.c
CC ../../py/nlrx86.c
CC ../../py/nlrx64.c
CC ../../py/nlrthumb.c
CC ../../py/nlrxtensa.c
CC ../../py/nlrsetjmp.c
CC ../../py/malloc.c
CC ../../py/gc.c
CC ../../py/pystack.c
CC ../../py/qstr.c
CC ../../py/vstr.c
CC ../../py/mpprint.c
CC ../../py/unicode.c
CC ../../py/mpz.c
CC ../../py/reader.c
CC ../../py/lexer.c
CC ../../py/parse.c
CC ../../py/scope.c
CC ../../py/compile.c
CC ../../py/emitcommon.c
CC ../../py/emitbc.c
CC ../../py/asmbase.c
CC ../../py/asmx64.c
CC ../../py/emitnx64.c
CC ../../py/asmx86.c
CC ../../py/emitnx86.c
CC ../../py/asmthumb.c
CC ../../py/emitnthumb.c
CC ../../py/emitinlinethumb.c
CC ../../py/asmarm.c
CC ../../py/emitnarm.c
CC ../../py/asmxtensa.c
CC ../../py/emitnxtensa.c
CC ../../py/emitinlinextensa.c
CC ../../py/formatfloat.c
CC ../../py/parsenumbase.c
CC ../../py/parsenum.c
CC ../../py/emitglue.c
CC ../../py/persistentcode.c
CC ../../py/runtime.c
CC ../../py/runtime_utils.c
CC ../../py/scheduler.c
CC ../../py/nativeglue.c
CC ../../py/stackctrl.c
CC ../../py/argcheck.c
CC ../../py/warning.c
CC ../../py/map.c
CC ../../py/obj.c
CC ../../py/objarray.c
CC ../../py/objattrtuple.c
CC ../../py/objbool.c
CC ../../py/objboundmeth.c
CC ../../py/objcell.c
CC ../../py/objclosure.c
CC ../../py/objcomplex.c
CC ../../py/objdeque.c
CC ../../py/objdict.c
CC ../../py/objenumerate.c
CC ../../py/objexcept.c
CC ../../py/objfilter.c
CC ../../py/objfloat.c
CC ../../py/objfun.c
CC ../../py/objgenerator.c
CC ../../py/objgetitemiter.c
CC ../../py/objint.c
CC ../../py/objint_longlong.c
CC ../../py/objint_mpz.c
CC ../../py/objlist.c
CC ../../py/objmap.c
CC ../../py/objmodule.c
CC ../../py/objobject.c
CC ../../py/objpolyiter.c
CC ../../py/objproperty.c
CC ../../py/objnone.c
CC ../../py/objnamedtuple.c
CC ../../py/objrange.c
CC ../../py/objreversed.c
CC ../../py/objset.c
CC ../../py/objsingleton.c
CC ../../py/objslice.c
CC ../../py/objstr.c
CC ../../py/objstrunicode.c
CC ../../py/objstringio.c
CC ../../py/objtuple.c
CC ../../py/objtype.c
CC ../../py/objzip.c
CC ../../py/opmethods.c
CC ../../py/sequence.c
CC ../../py/stream.c
CC ../../py/binary.c
CC ../../py/builtinimport.c
CC ../../py/builtinevex.c
CC ../../py/builtinhelp.c
CC ../../py/modarray.c
CC ../../py/modbuiltins.c
CC ../../py/modcollections.c
CC ../../py/modgc.c
CC ../../py/modio.c
CC ../../py/modmath.c
CC ../../py/modcmath.c
CC ../../py/modmicropython.c
CC ../../py/modstruct.c
CC ../../py/modsys.c
CC ../../py/moduerrno.c
CC ../../py/modthread.c
CC ../../py/vm.c
CC ../../py/bc.c
CC ../../py/showbc.c
CC ../../py/repl.c
CC ../../py/smallint.c
CC ../../py/frozenmod.c
CC ../../extmod/moductypes.c
CC ../../extmod/modujson.c
CC ../../extmod/modure.c
CC ../../extmod/moduzlib.c
CC ../../extmod/moduheapq.c
CC ../../extmod/modutimeq.c
CC ../../extmod/moduhashlib.c
CC ../../extmod/moducryptolib.c
CC ../../extmod/modubinascii.c
CC ../../extmod/virtpin.c
CC ../../extmod/machine_mem.c
CC ../../extmod/machine_pinbase.c
CC ../../extmod/machine_signal.c
CC ../../extmod/machine_pulse.c
CC ../../extmod/machine_i2c.c
CC ../../extmod/machine_spi.c
CC ../../extmod/modussl_axtls.c
CC ../../extmod/modussl_mbedtls.c
CC ../../extmod/modurandom.c
CC ../../extmod/moduselect.c
CC ../../extmod/moduwebsocket.c
CC ../../extmod/modwebrepl.c
CC ../../extmod/modframebuf.c
CC ../../extmod/vfs.c
CC ../../extmod/vfs_reader.c
CC ../../extmod/vfs_posix.c
CC ../../extmod/vfs_posix_file.c
CC ../../extmod/vfs_fat.c
CC ../../extmod/vfs_fat_diskio.c
CC ../../extmod/vfs_fat_file.c
CC ../../extmod/utime_mphal.c
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
GEN build/frozen.c
CC build/frozen.c
make[1]: Entering directory '/home/pi/micropython/mpy-cross'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/py/
CC ../py/mpstate.c
CC ../py/nlr.c
CC ../py/nlrx86.c
CC ../py/nlrx64.c
CC ../py/nlrthumb.c
CC ../py/nlrxtensa.c
CC ../py/nlrsetjmp.c
CC ../py/malloc.c
CC ../py/gc.c
CC ../py/pystack.c
CC ../py/qstr.c
CC ../py/vstr.c
CC ../py/mpprint.c
CC ../py/unicode.c
CC ../py/mpz.c
CC ../py/reader.c
CC ../py/lexer.c
CC ../py/parse.c
CC ../py/scope.c
CC ../py/compile.c
CC ../py/emitcommon.c
CC ../py/emitbc.c
CC ../py/asmbase.c
CC ../py/asmx64.c
CC ../py/emitnx64.c
CC ../py/asmx86.c
CC ../py/emitnx86.c
CC ../py/asmthumb.c
CC ../py/emitnthumb.c
CC ../py/emitinlinethumb.c
CC ../py/asmarm.c
CC ../py/emitnarm.c
CC ../py/asmxtensa.c
CC ../py/emitnxtensa.c
CC ../py/emitinlinextensa.c
CC ../py/formatfloat.c
CC ../py/parsenumbase.c
CC ../py/parsenum.c
CC ../py/emitglue.c
CC ../py/persistentcode.c
CC ../py/runtime.c
CC ../py/runtime_utils.c
CC ../py/scheduler.c
CC ../py/nativeglue.c
CC ../py/stackctrl.c
CC ../py/argcheck.c
CC ../py/warning.c
CC ../py/map.c
CC ../py/obj.c
CC ../py/objarray.c
CC ../py/objattrtuple.c
CC ../py/objbool.c
CC ../py/objboundmeth.c
CC ../py/objcell.c
CC ../py/objclosure.c
CC ../py/objcomplex.c
CC ../py/objdeque.c
CC ../py/objdict.c
CC ../py/objenumerate.c
CC ../py/objexcept.c
CC ../py/objfilter.c
CC ../py/objfloat.c
CC ../py/objfun.c
CC ../py/objgenerator.c
CC ../py/objgetitemiter.c
CC ../py/objint.c
CC ../py/objint_longlong.c
CC ../py/objint_mpz.c
CC ../py/objlist.c
CC ../py/objmap.c
CC ../py/objmodule.c
CC ../py/objobject.c
CC ../py/objpolyiter.c
CC ../py/objproperty.c
CC ../py/objnone.c
CC ../py/objnamedtuple.c
CC ../py/objrange.c
CC ../py/objreversed.c
CC ../py/objset.c
CC ../py/objsingleton.c
CC ../py/objslice.c
CC ../py/objstr.c
CC ../py/objstrunicode.c
CC ../py/objstringio.c
CC ../py/objtuple.c
CC ../py/objtype.c
CC ../py/objzip.c
CC ../py/opmethods.c
CC ../py/sequence.c
CC ../py/stream.c
CC ../py/binary.c
CC ../py/builtinimport.c
CC ../py/builtinevex.c
CC ../py/builtinhelp.c
CC ../py/modarray.c
CC ../py/modbuiltins.c
CC ../py/modcollections.c
CC ../py/modgc.c
CC ../py/modio.c
CC ../py/modmath.c
CC ../py/modcmath.c
CC ../py/modmicropython.c
CC ../py/modstruct.c
CC ../py/modsys.c
CC ../py/moduerrno.c
CC ../py/modthread.c
CC ../py/vm.c
CC ../py/bc.c
CC ../py/showbc.c
CC ../py/repl.c
CC ../py/smallint.c
CC ../py/frozenmod.c
CC main.c
CC gccollect.c
LINK mpy-cross
   text    data     bss     dec     hex filename
 290723     404     432  291559   472e7 mpy-cross
make[1]: Leaving directory '/home/pi/micropython/mpy-cross'
MPY modules/upip.py
MPY modules/upip_utarfile.py
GEN build/frozen_mpy.c
CC build/frozen_mpy.c
CC main.c
CC gccollect.c
CC unix_mphal.c
CC mpthreadport.c
CC input.c
CC file.c
CC modmachine.c
CC modos.c
CC moduos_vfs.c
CC modtime.c
CC moduselect.c
CC alloc.c
CC coverage.c
CC fatfs_port.c
CC ../../lib/axtls/ssl/asn1.c
CC ../../lib/axtls/ssl/loader.c
CC ../../lib/axtls/ssl/tls1.c
CC ../../lib/axtls/ssl/tls1_svr.c
CC ../../lib/axtls/ssl/tls1_clnt.c
CC ../../lib/axtls/ssl/x509.c
CC ../../lib/axtls/crypto/aes.c
CC ../../lib/axtls/crypto/bigint.c
CC ../../lib/axtls/crypto/crypto_misc.c
CC ../../lib/axtls/crypto/hmac.c
CC ../../lib/axtls/crypto/md5.c
CC ../../lib/axtls/crypto/rsa.c
CC ../../lib/axtls/crypto/sha1.c
CC ../../extmod/modbtree.c
CC ../../lib/berkeley-db-1.xx/btree/bt_close.c
CC ../../lib/berkeley-db-1.xx/btree/bt_conv.c
CC ../../lib/berkeley-db-1.xx/btree/bt_debug.c
CC ../../lib/berkeley-db-1.xx/btree/bt_delete.c
CC ../../lib/berkeley-db-1.xx/btree/bt_get.c
CC ../../lib/berkeley-db-1.xx/btree/bt_open.c
CC ../../lib/berkeley-db-1.xx/btree/bt_overflow.c
CC ../../lib/berkeley-db-1.xx/btree/bt_page.c
CC ../../lib/berkeley-db-1.xx/btree/bt_put.c
CC ../../lib/berkeley-db-1.xx/btree/bt_search.c
CC ../../lib/berkeley-db-1.xx/btree/bt_seq.c
CC ../../lib/berkeley-db-1.xx/btree/bt_split.c
CC ../../lib/berkeley-db-1.xx/btree/bt_utils.c
CC ../../lib/berkeley-db-1.xx/mpool/mpool.c
CC modtermios.c
CC modusocket.c
CC modffi.c
CC ../../lib/mp-readline/readline.c
CC ../../lib/timeutils/timeutils.c
CC ../../lib/oofatfs/ff.c
CC ../../lib/oofatfs/ffunicode.c
LINK micropython
   text    data     bss     dec     hex filename
      2       0       0       2       2 build/build/frozen.o
   3412    3716       0    7128    1bd8 build/build/frozen_mpy.o
 303356    4732    1240  309328   4b850 micropython
[email protected]:~/micropython/ports/unix $ ./micropython
MicroPython v1.10-323-g906fb89fd on 2019-05-03; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> 
I am not sure what the problem would be which you are having. Which Pi do you have, and which OS are you using ?

It might be worth clearing the entire ~/micropython directory and tree and trying again. Perhaps keep and post a full record of what reports you get from start to finish, check to see where it differs from what I get above..

zazinio
Posts: 4
Joined: Fri May 03, 2019 5:35 pm

Re: Installing MicroPython - How To Guide

Sat May 04, 2019 1:31 pm

last month it was working and i had install various programs for solving rubiks cube and one of them change somthing and everything stop working. Reinstall rasbian and try to install micropython as by instructions but fail. Now my raspberry is

Code: Select all

[email protected]:~ $ pinout
,--------------------------------.
| oooooooooooooooooooo J8     +====
| 1ooooooooooooooooooo      P | USB
|  Wi                     ooo +====
|  Fi  Pi Model 3B+ V1.3  ooE    |
|        ,----.               +====
| |D|    |SoC |               | USB
| |S|    |    |               +====
| |I|    `----'                  |
|                   |C|     +======
|                   |S|     |   Net
| pwr        |HDMI| |I||A|  +======
`-| |--------|    |----|V|-------'

Revision           : a020d3
SoC                : BCM2837
RAM                : 1024Mb
Storage            : MicroSD
USB ports          : 4 (excluding power)
Ethernet ports     : 1
Wi-fi              : True
Bluetooth          : True
Camera ports (CSI) : 1
Display ports (DSI): 1

J8:
   3V3  (1) (2)  5V    
 GPIO2  (3) (4)  5V    
 GPIO3  (5) (6)  GND   
 GPIO4  (7) (8)  GPIO14
   GND  (9) (10) GPIO15
GPIO17 (11) (12) GPIO18
GPIO27 (13) (14) GND   
GPIO22 (15) (16) GPIO23
   3V3 (17) (18) GPIO24
GPIO10 (19) (20) GND   
 GPIO9 (21) (22) GPIO25
GPIO11 (23) (24) GPIO8 
   GND (25) (26) GPIO7 
 GPIO0 (27) (28) GPIO1 
 GPIO5 (29) (30) GND   
 GPIO6 (31) (32) GPIO12
GPIO13 (33) (34) GND   
GPIO19 (35) (36) GPIO16
GPIO26 (37) (38) GPIO20
   GND (39) (40) GPIO21

For further information, please refer to https://pinout.xyz/
and rasbian version is

Code: Select all

[email protected]:~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 9.9 (stretch)
Release:	9.9
Codename:	stretch
i delete micropython folder and folow your way

Code: Select all

[email protected]:~ $ git clone https://github.com/micropython/micropython.git
Клониране и създаване на хранилище в „micropython“…
remote: Enumerating objects: 40, done.
remote: Counting objects: 100% (40/40), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 69980 (delta 17), reused 18 (delta 12), pack-reused 69940
Получаване на обекти: 100% (69980/69980), 39.39 MiB | 3.76 MiB/s, действието завърши.
Откриване на съответните разлики: 100% (50525/50525), действието завърши.
[email protected]:~ $ cd micropython
[email protected]:~/micropython $ git pull
Already up-to-date.
[email protected]:~/micropython $ cd ports
[email protected]:~/micropython/ports $ cd unix
[email protected]:~/micropython/ports/unix $ make clean
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
rm -f micropython
rm -f micropython.map
rm -rf build 
[email protected]:~/micropython/ports/unix $ make axtls
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
You cloned without --recursive, fetching submodules for you.
(cd ../..; git submodule update --init --recursive)
Регистриран е подмодул „lib/axtls“ (https://github.com/pfalcon/axtls) за пътя към подмодул „lib/axtls“
Регистриран е подмодул „lib/berkeley-db-1.xx“ (https://github.com/pfalcon/berkeley-db-1.xx) за пътя към подмодул „lib/berkeley-db-1.xx“
Регистриран е подмодул „lib/libffi“ (https://github.com/atgreen/libffi) за пътя към подмодул „lib/libffi“
Регистриран е подмодул „lib/lwip“ (https://git.savannah.gnu.org/r/lwip.git) за пътя към подмодул „lib/lwip“
Регистриран е подмодул „lib/nrfx“ (https://github.com/NordicSemiconductor/nrfx.git) за пътя към подмодул „lib/nrfx“
Регистриран е подмодул „lib/stm32lib“ (https://github.com/micropython/stm32lib) за пътя към подмодул „lib/stm32lib“
Клониране и създаване на хранилище в „/home/pi/micropython/lib/axtls“…
Клониране и създаване на хранилище в „/home/pi/micropython/lib/berkeley-db-1.xx“…
Клониране и създаване на хранилище в „/home/pi/micropython/lib/libffi“…
Клониране и създаване на хранилище в „/home/pi/micropython/lib/lwip“…
Клониране и създаване на хранилище в „/home/pi/micropython/lib/nrfx“…
Клониране и създаване на хранилище в „/home/pi/micropython/lib/stm32lib“…
Път към подмодул „lib/axtls“: изтеглена е версия „43a6e6bd3bbc03dc501e16b89fba0ef042ed3ea0“
Път към подмодул „lib/berkeley-db-1.xx“: изтеглена е версия „35aaec4418ad78628a3b935885dd189d41ce779b“
Път към подмодул „lib/libffi“: изтеглена е версия „e9de7e35f2339598b16cbb375f9992643ed81209“
Път към подмодул „lib/lwip“: изтеглена е версия „92f23d6ca0971a32f2085b9480e738d34174417b“
Път към подмодул „lib/nrfx“: изтеглена е версия „d4ebe15f58de1442e3eed93b40d13930e7785903“
Път към подмодул „lib/stm32lib“: изтеглена е версия „a5e93de18479879dd129cf6272cfd75e0c794bd4“
[email protected]:~/micropython/ports/unix $ make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/build/
mkdir -p build/extmod/
mkdir -p build/lib/axtls/crypto/
mkdir -p build/lib/axtls/ssl/
mkdir -p build/lib/berkeley-db-1.xx/btree/
mkdir -p build/lib/berkeley-db-1.xx/mpool/
mkdir -p build/lib/embed/
mkdir -p build/lib/mp-readline/
mkdir -p build/lib/oofatfs/
mkdir -p build/lib/timeutils/
mkdir -p build/lib/utils/
mkdir -p build/py/
CC ../../py/mpstate.c
CC ../../py/nlr.c
CC ../../py/nlrx86.c
CC ../../py/nlrx64.c
CC ../../py/nlrthumb.c
CC ../../py/nlrxtensa.c
CC ../../py/nlrsetjmp.c
CC ../../py/malloc.c
CC ../../py/gc.c
CC ../../py/pystack.c
CC ../../py/qstr.c
CC ../../py/vstr.c
CC ../../py/mpprint.c
CC ../../py/unicode.c
CC ../../py/mpz.c
CC ../../py/reader.c
CC ../../py/lexer.c
CC ../../py/parse.c
CC ../../py/scope.c
CC ../../py/compile.c
CC ../../py/emitcommon.c
CC ../../py/emitbc.c
CC ../../py/asmbase.c
CC ../../py/asmx64.c
CC ../../py/emitnx64.c
CC ../../py/asmx86.c
CC ../../py/emitnx86.c
CC ../../py/asmthumb.c
CC ../../py/emitnthumb.c
CC ../../py/emitinlinethumb.c
CC ../../py/asmarm.c
CC ../../py/emitnarm.c
CC ../../py/asmxtensa.c
CC ../../py/emitnxtensa.c
CC ../../py/emitinlinextensa.c
CC ../../py/formatfloat.c
CC ../../py/parsenumbase.c
CC ../../py/parsenum.c
CC ../../py/emitglue.c
CC ../../py/persistentcode.c
CC ../../py/runtime.c
CC ../../py/runtime_utils.c
CC ../../py/scheduler.c
CC ../../py/nativeglue.c
CC ../../py/stackctrl.c
CC ../../py/argcheck.c
CC ../../py/warning.c
CC ../../py/map.c
CC ../../py/obj.c
CC ../../py/objarray.c
CC ../../py/objattrtuple.c
CC ../../py/objbool.c
CC ../../py/objboundmeth.c
CC ../../py/objcell.c
CC ../../py/objclosure.c
CC ../../py/objcomplex.c
CC ../../py/objdeque.c
CC ../../py/objdict.c
CC ../../py/objenumerate.c
CC ../../py/objexcept.c
CC ../../py/objfilter.c
CC ../../py/objfloat.c
CC ../../py/objfun.c
CC ../../py/objgenerator.c
CC ../../py/objgetitemiter.c
CC ../../py/objint.c
CC ../../py/objint_longlong.c
CC ../../py/objint_mpz.c
CC ../../py/objlist.c
CC ../../py/objmap.c
CC ../../py/objmodule.c
CC ../../py/objobject.c
CC ../../py/objpolyiter.c
CC ../../py/objproperty.c
CC ../../py/objnone.c
CC ../../py/objnamedtuple.c
CC ../../py/objrange.c
CC ../../py/objreversed.c
CC ../../py/objset.c
CC ../../py/objsingleton.c
CC ../../py/objslice.c
CC ../../py/objstr.c
CC ../../py/objstrunicode.c
CC ../../py/objstringio.c
CC ../../py/objtuple.c
CC ../../py/objtype.c
CC ../../py/objzip.c
CC ../../py/opmethods.c
CC ../../py/sequence.c
CC ../../py/stream.c
CC ../../py/binary.c
CC ../../py/builtinimport.c
CC ../../py/builtinevex.c
CC ../../py/builtinhelp.c
CC ../../py/modarray.c
CC ../../py/modbuiltins.c
CC ../../py/modcollections.c
CC ../../py/modgc.c
CC ../../py/modio.c
CC ../../py/modmath.c
CC ../../py/modcmath.c
CC ../../py/modmicropython.c
CC ../../py/modstruct.c
CC ../../py/modsys.c
CC ../../py/moduerrno.c
CC ../../py/modthread.c
CC ../../py/vm.c
CC ../../py/bc.c
CC ../../py/showbc.c
CC ../../py/repl.c
CC ../../py/smallint.c
CC ../../py/frozenmod.c
CC ../../extmod/moductypes.c
CC ../../extmod/modujson.c
CC ../../extmod/modure.c
CC ../../extmod/moduzlib.c
CC ../../extmod/moduheapq.c
CC ../../extmod/modutimeq.c
CC ../../extmod/moduhashlib.c
CC ../../extmod/moducryptolib.c
CC ../../extmod/modubinascii.c
CC ../../extmod/virtpin.c
CC ../../extmod/machine_mem.c
CC ../../extmod/machine_pinbase.c
CC ../../extmod/machine_signal.c
CC ../../extmod/machine_pulse.c
CC ../../extmod/machine_i2c.c
CC ../../extmod/machine_spi.c
CC ../../extmod/modussl_axtls.c
CC ../../extmod/modussl_mbedtls.c
CC ../../extmod/modurandom.c
CC ../../extmod/moduselect.c
CC ../../extmod/moduwebsocket.c
CC ../../extmod/modwebrepl.c
CC ../../extmod/modframebuf.c
CC ../../extmod/vfs.c
CC ../../extmod/vfs_reader.c
CC ../../extmod/vfs_posix.c
CC ../../extmod/vfs_posix_file.c
CC ../../extmod/vfs_fat.c
CC ../../extmod/vfs_fat_diskio.c
CC ../../extmod/vfs_fat_file.c
CC ../../extmod/utime_mphal.c
CC ../../extmod/uos_dupterm.c
CC ../../lib/embed/abort_.c
CC ../../lib/utils/printf.c
GEN build/frozen.c
CC build/frozen.c
make[1]: Entering directory '/home/pi/micropython/mpy-cross'
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build/genhdr
GEN build/genhdr/mpversion.h
GEN build/genhdr/moduledefs.h
GEN build/genhdr/qstr.i.last
GEN build/genhdr/qstr.split
GEN build/genhdr/qstrdefs.collected.h
QSTR updated
GEN build/genhdr/qstrdefs.generated.h
mkdir -p build/py/
CC ../py/mpstate.c
CC ../py/nlr.c
CC ../py/nlrx86.c
CC ../py/nlrx64.c
CC ../py/nlrthumb.c
CC ../py/nlrxtensa.c
CC ../py/nlrsetjmp.c
CC ../py/malloc.c
CC ../py/gc.c
CC ../py/pystack.c
CC ../py/qstr.c
CC ../py/vstr.c
CC ../py/mpprint.c
CC ../py/unicode.c
CC ../py/mpz.c
CC ../py/reader.c
CC ../py/lexer.c
CC ../py/parse.c
CC ../py/scope.c
CC ../py/compile.c
CC ../py/emitcommon.c
CC ../py/emitbc.c
CC ../py/asmbase.c
CC ../py/asmx64.c
CC ../py/emitnx64.c
CC ../py/asmx86.c
CC ../py/emitnx86.c
CC ../py/asmthumb.c
CC ../py/emitnthumb.c
CC ../py/emitinlinethumb.c
CC ../py/asmarm.c
CC ../py/emitnarm.c
CC ../py/asmxtensa.c
CC ../py/emitnxtensa.c
CC ../py/emitinlinextensa.c
CC ../py/formatfloat.c
CC ../py/parsenumbase.c
CC ../py/parsenum.c
CC ../py/emitglue.c
CC ../py/persistentcode.c
CC ../py/runtime.c
CC ../py/runtime_utils.c
CC ../py/scheduler.c
CC ../py/nativeglue.c
CC ../py/stackctrl.c
CC ../py/argcheck.c
CC ../py/warning.c
CC ../py/map.c
CC ../py/obj.c
CC ../py/objarray.c
CC ../py/objattrtuple.c
CC ../py/objbool.c
CC ../py/objboundmeth.c
CC ../py/objcell.c
CC ../py/objclosure.c
CC ../py/objcomplex.c
CC ../py/objdeque.c
CC ../py/objdict.c
CC ../py/objenumerate.c
CC ../py/objexcept.c
CC ../py/objfilter.c
CC ../py/objfloat.c
CC ../py/objfun.c
CC ../py/objgenerator.c
CC ../py/objgetitemiter.c
CC ../py/objint.c
CC ../py/objint_longlong.c
CC ../py/objint_mpz.c
CC ../py/objlist.c
CC ../py/objmap.c
CC ../py/objmodule.c
CC ../py/objobject.c
CC ../py/objpolyiter.c
CC ../py/objproperty.c
CC ../py/objnone.c
CC ../py/objnamedtuple.c
CC ../py/objrange.c
CC ../py/objreversed.c
CC ../py/objset.c
CC ../py/objsingleton.c
CC ../py/objslice.c
CC ../py/objstr.c
CC ../py/objstrunicode.c
CC ../py/objstringio.c
CC ../py/objtuple.c
CC ../py/objtype.c
CC ../py/objzip.c
CC ../py/opmethods.c
CC ../py/sequence.c
CC ../py/stream.c
CC ../py/binary.c
CC ../py/builtinimport.c
CC ../py/builtinevex.c
CC ../py/builtinhelp.c
CC ../py/modarray.c
CC ../py/modbuiltins.c
CC ../py/modcollections.c
CC ../py/modgc.c
CC ../py/modio.c
CC ../py/modmath.c
CC ../py/modcmath.c
CC ../py/modmicropython.c
CC ../py/modstruct.c
CC ../py/modsys.c
CC ../py/moduerrno.c
CC ../py/modthread.c
CC ../py/vm.c
CC ../py/bc.c
CC ../py/showbc.c
CC ../py/repl.c
CC ../py/smallint.c
CC ../py/frozenmod.c
CC main.c
CC gccollect.c
LINK mpy-cross
collect2: fatal error: ld terminated with signal 11 [Нарушение на разделянето(segfault)]
compilation terminated.
../py/mkrules.mk:132: recipe for target 'mpy-cross' failed
make[1]: *** [mpy-cross] Error 1
make[1]: *** Deleting file 'mpy-cross'
make[1]: Leaving directory '/home/pi/micropython/mpy-cross'
../../py/mkrules.mk:108: recipe for target '../../mpy-cross/mpy-cross' failed
make: *** [../../mpy-cross/mpy-cross] Error 2
[email protected]:~/micropython/ports/unix $ 
and that is what hapen

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Sat May 04, 2019 9:31 pm

With the 'segfault' I imagine something 'very bad' has happened internally. I have no idea what or how one would even try to discover what caused it, let alone resolve it. I'm 'just some guy who posted instructions on what worked for me' I am afraid.

I notice you have a non-English language selected; it could be as simple as something like that which is provoking the failure. Or how your specific Pi is configured, memory partitioning, what else you are running. Could be any number of things. I can only guess.

Perhaps turn the verbose option on as described to see if that gives any clearer picture of what is happening or going wrong.

I would try to find someone else with a Pi 3B+ to see if they can build it. That would at least give some pointer towards whether it is a generic issue, a Pi 3B+ related issue, or more specific to your configuration.

My Pi 3B+ isn't available right now so I cannot try that. You could ask if there are any forum members here willing to try building it as it's not that onerous. It is probably best to post a new thread asking if someone could try it, because I imagine few will otherwise wander into this one.

The MicroPython development team might have some advice to offer but I suspect you're going to struggle against "works for me" as the best which can be offered.

zazinio
Posts: 4
Joined: Fri May 03, 2019 5:35 pm

Re: Installing MicroPython - How To Guide

Sun May 05, 2019 6:44 am

Can you gaid me to micropython team to ask them for help.
Otherwise pi configuration is not problem cose i follow instructions only select bulgarian but something else cause the problem. Now i can try every variant of "works for me" to make it run for me.

User avatar
B.Goode
Posts: 8575
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Installing MicroPython - How To Guide

Sun May 05, 2019 7:06 am

zazinio wrote:
Sun May 05, 2019 6:44 am
Can you gaid me to micropython team to ask them for help.
Otherwise pi configuration is not problem cose i follow instructions only select bulgarian but something else cause the problem. Now i can try every variant of "works for me" to make it run for me.


Guide me?

Perhaps here: https://github.com/micropython/micropython/issues

zazinio
Posts: 4
Joined: Fri May 03, 2019 5:35 pm

Re: Installing MicroPython - How To Guide

Mon May 06, 2019 5:56 pm

Problem solved to finish build must be cut off internet connection that solved everything

isan98
Posts: 35
Joined: Sun May 14, 2017 6:36 am

Re: Installing MicroPython - How To Guide

Sun Jul 07, 2019 7:21 am

Hi, I get this when I run make

Code: Select all

GEN build/frozen.c
CC build/frozen.c
MPY modules/upip.py
make: ../../mpy-cross/mpy-cross: Command not found
make: *** [../../py/mkrules.mk:114: build/frozen_mpy/upip.mpy] Error 127
How can I fix it?

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Sun Jul 07, 2019 3:10 pm

isan98 wrote:
Sun Jul 07, 2019 7:21 am
Hi, I get this when I run make

Code: Select all

GEN build/frozen.c
CC build/frozen.c
MPY modules/upip.py
make: ../../mpy-cross/mpy-cross: Command not found
make: *** [../../py/mkrules.mk:114: build/frozen_mpy/upip.mpy] Error 127
How can I fix it?
I have the same issue when I try to build it on my Pi 3B with Buster installed following my instructions which previously worked.

Looking at ~/micropython/README.md it seems mpy-cross has to be explicitly built when it didn't need to be previously. So -

Code: Select all

cd ~/micropython/mpy-cross
make
After that running the following seems to get it built as expected ...

Code: Select all

cd ~/micropython/ports/unix
make

Code: Select all

[email protected]:~/micropython/ports/unix $ ./micropython
MicroPython v1.11-126-g7c2e83324 on 2019-07-07; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> 

Code: Select all

[email protected]:~/micropython/ports/unix $ make test
....
708 tests performed (19405 individual testcases)
708 tests passed
37 tests skipped: ....
Thanks for reporting the issue and I will update my instructions.

hippy
Posts: 5962
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Installing MicroPython - How To Guide

Sun Jul 07, 2019 3:50 pm

Running the 'fibo(24) a million times' benchmark detailed earlier it seems that while there have been quite significant speed improvements with the default Python 2 and Python 3.x supplied with Buster, MicroPython has become a little slower.

MicroPython is no longer much faster than Python 3.x, and is now more comparable with Python 3.x, much slower than Python 2 -

Code: Select all

Pi 3B  : python 3.7.3                 24.269312143325806
Pi 3B  : Unix MicroPython v1.11-126   23.54611206054688
Pi 3B  : Python 2.7.16                17.8407390118
Previously -

Code: Select all

Pi 3B  : python 3.5.3                 29.223081588745117
Pi 3B  : Python 2.7.13                23.8396651745
Pi 3B  : Unix MicroPython v1.10-278   22.70570516586304
Given that, it likely no longer makes sense to use MicroPython simply to gain a speed advantage, though overall speed will depend on what the program is doing.

Return to “Python”