0

I really have tried searching through all the forums. confusing. The makers of Roboclaw wrote their test pythons scripts (and Roboclaw class) with Python 2.7. As of now, will NOT work with python v3.

So I'm stuck with that restriction.

When I run the basic script, it complains that "AttributeError: Roboclaw instance has no attribute '_port'".

Tech support just keeps telling people they need python 2.7.

What I did was "sudo apt-get install python-serial". No luck. Still same problem.

What I wanted to do was blow away ALL python and re-install just what I need.. but I read (?) that raspbian/debian uses python for things?

Anyway, here's what "dpkg --get-selections|grep python" says :

dh-python install
libpython-stdlib:armhf install
libpython2.7-minimal:armhf install
libpython2.7-stdlib:armhf install
libpython3-stdlib:armhf install
libpython3.5:armhf install
libpython3.5-minimal:armhf install
libpython3.5-stdlib:armhf install
python install
python-apt-common install
python-minimal install
python-serial install
python2.7 install
python2.7-minimal install
python3 install
python3-apt install
python3-minimal install
python3.5 install
python3.5-minimal install


Any ideas?

Update (05/23/2018 @ 22:32 EDT):

I tried "sudo apt-get install python3-serial". No luck.

Error is:

Traceback (most recent call last): File "roboclaw_simplepwm.py", line 14, in rc.ForwardM1(address,32) #1/4 power forward File "/home/devchu/dev/roboclaw_python/roboclaw_python/roboclaw.py", line 647, in ForwardM1 return self._write1(address,self.Cmd.M1FORWARD,val) File "/home/devchu/dev/roboclaw_python/roboclaw_python/roboclaw.py", line 311, in _write1 self._sendcommand(address,cmd) File "/home/devchu/dev/roboclaw_python/roboclaw_python/roboclaw.py", line 126, in _sendcommand self._port.write(chr(address)) AttributeError: Roboclaw instance has no attribute '_port'

dpkg --get-selections|grep python
dh-python install
libpython-stdlib:armhf install
libpython2.7-minimal:armhf install
libpython2.7-stdlib:armhf install
libpython3-stdlib:armhf install
libpython3.5:armhf install
libpython3.5-minimal:armhf install
libpython3.5-stdlib:armhf install
python install
python-apt-common install
python-minimal install
python-serial install
python2.7 install
python2.7-minimal install
python3 install
python3-apt install
python3-minimal install
python3-serial install
python3.5 install
python3.5-minimal install

  • Try installing python3 version like so sudo apt-get install python3-serial. my guess is python-serial is the version compatible with python 2.7. – Shreyas Murali May 24 '18 at 2:21
  • Blowing away python will render the OS fairly crippled when it comes to package management (been there, done that). one alternative way is to use virtualenv to create sandboxes containing only packages you require for your script as opposed to installing system wide. the link should have the installation procedure – Shreyas Murali May 24 '18 at 2:24
  • hi, thanks for the suggestion.. (I'm new here going to update - no luck).. – ecorrales May 24 '18 at 2:31
  • might help checking this out – Shreyas Murali May 24 '18 at 2:51
  • What operating system you are using? I use Raspbian Stretch Lite 2018-04-18 but cannot find apt list *roboclaw*. What is roboclow? – Ingo May 24 '18 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.