Import error message
Forums:
I have been trying to write some python code to manipulate a motor with the PI and ThunderBorg board.
When I try to write an import function to use the ThunderBorg.py file I am met with an error message (see photo attached).
I have expanded the working directory to include the ThunderBorg filepath but this has not made a difference.
I have already gone through the initial installation for Thunder Borg without any problems.
Any suggestions as to how I fix this would be great
Thank you
piborg
Thu, 06/18/2020 - 19:10
Permalink
No module named 'ThunderBorg'
The error is that the
ThunderBorg.py
script cannot be found. There are three simple ways to fix this.1. Change to the ThunderBorg directory
This is the solution you are already trying, the problem is that the path needs to be the
~/thunderborg
directory itself.Pro: This is probably the simplest solution.
Con: If you need to import other scripts it can get confusing.
2. Add the ThunderBorg directory to the search path
This is my usual choice as I sometimes need the current directory to stay where it is. You can also add multiple directories this way for different imports.
Pro: Does not change the directory.
Con: The path order matters if you have the same script name in different directories.
3. Copy the ThunderBorg.py script into the same directory
This is the easiest to understand. Simply copy the
ThunderBorg.py
script into the same directory as the script you are writing.Pro: No code changes required, just import normally.
Con: There are multiple stored copies of the same script.
Liam
Sun, 07/26/2020 - 16:11
Permalink
GUI not working
Hi,
I have been trying to use the ThunderBorg GUI but it does not load.
Similarly the ThunderBorg is not found in the code I wrote (attached).
Initially I thought that the TunderBorg was not on the right address so I set a new address in the terminal to match with the address suggested by the output code.
However I am still getting an error message.
piborg
Mon, 07/27/2020 - 10:41
Permalink
ThunderBorg I2C address
The default address for ThunderBorg is
21
, which is also written as0x15
.If you change the address number to
21
both the scripts should start working again :)CougarTG
Tue, 08/17/2021 - 15:08
Permalink
how would i change that?
how do i change the bus
when i do
.runMonsterJoy.sh
its says
loading thunderborg on bus 1, adress 15
missing thunderbord at 15
are you sure its it properly attracted, the correct address is used, and i2c drivers are running
no thunder borg boards found
I have no clue whats wrong
piborg
Wed, 08/18/2021 - 13:28
Permalink
See other thread
I have posted a reply on your other thread: No ThunderBorg found