florisla / stm32loader

Flash firmware to STM32 microcontrollers using Python.
GNU General Public License v3.0
111 stars 55 forks source link

ModuleNotFoundError: No module named 'stm32loader' #47

Closed jj-uk closed 3 years ago

jj-uk commented 4 years ago

What't the correct way to use this code? I'm getting a module not found error:

python --version
Python 3.8.2
git clone https://github.com/florisla/stm32loader.git
cd stm32loader
python ./stm32loader -p /dev/tty.SLAB_USBtoUART -e -w -v ~/mbp/blackmagic/src/blackmagic_dfu.bin
~/mbp/stm32loader$ python ./stm32loader -p /dev/tty.SLAB_USBtoUART -e -w -v src/blackmagic_dfu.bin
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "./stm32loader/__main__.py", line 27, in <module>
    from stm32loader.main import main as stm32loader_main
ModuleNotFoundError: No module named 'stm32loader'
florisla commented 4 years ago

You can install the module with pip install stm32loader.

Next, simply execute 'stm32loader' as an executable.

If you're running from the git folder:

git clone https://github.com/florisla/stm32loader.git
cd stm32loader
python -m stm32loader -p /dev/tty.SLAB_USBtoUART -e -w -v ~/mbp/blackmagic/src/blackmagic_dfu.bin
python stm32loader/main.py -p /dev/tty.SLAB_USBtoUART -e -w -v ~/mbp/blackmagic/src/blackmagic_dfu.bin
florisla commented 3 years ago

Closing in favor of #52.