User avatar
Mettauk
Posts: 237
Joined: Mon Dec 10, 2012 12:40 pm
Location: Zarg

import module - Piborg confusion

Sun Jun 19, 2016 12:17 am

This is probably really simple but I'm lost.
I have one set of software for a motor controller PicoBorgRev and another for distance and servos UltraBorg.

I have a python script that starts with

Code: Select all

import UltraBorg
import PicoBorgRev
import time
import math
import sys
...
that I cannot get to run...

If I run it from within a PicoBorgRev folder say diddyred it fails with

Code: Select all

:~/diddyred $ sudo python diddyFromDistance.py
Traceback (most recent call last):
  File "diddyFromDistance.py", line 5, in <module>
    import UltraBorg
ImportError: No module named UltraBorg
If I run it from within an untraborg folder say ultraborg it fails with

Code: Select all

:~/ultraborg $ sudo python diddyFromDistance.py
Traceback (most recent call last):
  File "diddyFromDistance.py", line 6, in <module>
    import PicoBorgRev
ImportError: No module named PicoBorgRev
Clearly I need to set a path or tell python where to find things but I don't know how?
As humans we have been the same for a very very long time, technology changes how we do... not who we are as people.

tom.slick
Posts: 190
Joined: Wed Jan 06, 2016 9:23 pm

Re: import module - Piborg confusion

Sun Jun 19, 2016 12:54 am

Put PicoBorgRev.py and UltraBorg.py in the same folder as your script.
or copy both files to /usr/lib/the_installed_version_of_python_that_you_are_using

most likely /usr/lib/python2.7/ or /usr/lib/python3.4

User avatar
Mettauk
Posts: 237
Joined: Mon Dec 10, 2012 12:40 pm
Location: Zarg

Re: import module - Piborg confusion

Sun Jun 19, 2016 1:27 am

Thank you!
As humans we have been the same for a very very long time, technology changes how we do... not who we are as people.

Return to “Python”