Software install for Adafruit DC and Stepper Motor HAT

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
bsmorgan
 
Posts: 14
Joined: Wed Apr 18, 2018 10:24 am

Software install for Adafruit DC and Stepper Motor HAT

Post by bsmorgan »

I just received a Adafruit DC and Stepper Motor HAT for Raspberry Pi and I'm following the instructions at https://learn.adafruit.com/adafruit-dc- ... g-software. The step "sudo python setup.py install" fails:

Code: Select all

pi@octopi:~/Adafruit-Motor-HAT-Python-Library $ ls -l
total 44
drwxr-xr-x 2 pi   pi    4096 Apr 21 17:15 Adafruit_MotorHAT
drwxr-xr-x 2 pi   pi    4096 Apr 21 17:15 examples
-rw-r--r-- 1 pi   pi   10332 Apr 21 17:15 ez_setup.py
-rw-r--r-- 1 root root 12174 Apr 21 17:15 ez_setup.pyc
-rw-r--r-- 1 pi   pi     639 Apr 21 17:15 README.md
-rw-r--r-- 1 pi   pi    1264 Apr 21 17:15 setup.py
pi@octopi:~/Adafruit-Motor-HAT-Python-Library $ sudo python setup.py install
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.5.1.zip
Extracting in /tmp/tmpnyht6v
Traceback (most recent call last):
  File "setup.py", line 4, in <module>
    use_setuptools()
  File "/home/pi/Adafruit-Motor-HAT-Python-Library/ez_setup.py", line 133, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/home/pi/Adafruit-Motor-HAT-Python-Library/ez_setup.py", line 108, in _do_download
    _build_egg(egg, archive, to_dir)
  File "/home/pi/Adafruit-Motor-HAT-Python-Library/ez_setup.py", line 57, in _build_egg
    with archive_context(archive_filename):
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/pi/Adafruit-Motor-HAT-Python-Library/ez_setup.py", line 88, in archive_context
    with get_zip_class()(filename) as archive:
  File "/usr/lib/python2.7/zipfile.py", line 770, in __init__
    self._RealGetContents()
  File "/usr/lib/python2.7/zipfile.py", line 811, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file
pi@octopi:~/Adafruit-Motor-HAT-Python-Library $ python -V
Python 2.7.9
pi@octopi:~/Adafruit-Motor-HAT-Python-Library $ uname -a
Linux octopi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
pi@octopi:~/Adafruit-Motor-HAT-Python-Library $
The OS on the Pi 3 is OctoPi, a version of Raspbian Jessie and comes bundled with OctoPrint for controlling my LulzBot TAZ 6 3D printer.

Have I done something wrong? The instructions were last updated on 2015-05-04. Are they still correct? Any help would be appreciated.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by adafruit_support_mike »

The error messages say there's something wrong with the zipfile the previous code downloaded.

I just downloaded and unzipped a copy of the file from that URL, and everything worked normally, so it doesn't look like there are any major problems there. The most likely issue would be a bad download.

Try running the setup script again and see if that does any good.

User avatar
bsmorgan
 
Posts: 14
Joined: Wed Apr 18, 2018 10:24 am

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by bsmorgan »

I did try the download multiple times and it always failed.

I did, however, get past that point by first following the Step 1 instructions for https://learn.adafruit.com/adafruit-pio ... y-pi/usage. That set of instructions was last updated on 2017-06-01. After installing those dependencies, the "sudo python setup.py install" for the Motor HAT completed successfully.

User avatar
bsmorgan
 
Posts: 14
Joined: Wed Apr 18, 2018 10:24 am

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by bsmorgan »

For what its worth, I downloaded the setuptools-3.5.1.zip file on my Windows 10 system and it opened successfully. It is 906KB in size. On the Raspberry Pi, the file that was downloaded was only 1KB in size. I did try multiple downloads before finding a solution that worked so I'm not sure why the download failed to fetch the complete file, but that was part of the problem.

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by adafruit_support_mike »

A file that small means there must have been some kind of problem with the connection.

I'll have the folks who handle that module take a look at the download part.

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by adafruit2 »

thanks you probably had to install some python-dev things, we've updated the command line instructions!

User avatar
bsmorgan
 
Posts: 14
Joined: Wed Apr 18, 2018 10:24 am

Re: Software install for Adafruit DC and Stepper Motor HAT

Post by bsmorgan »

Thank you!

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”