Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most recent PyBBIO fails during installation #5

Closed
GoVirtual opened this issue Jun 22, 2012 · 24 comments
Closed

Most recent PyBBIO fails during installation #5

GoVirtual opened this issue Jun 22, 2012 · 24 comments

Comments

@GoVirtual
Copy link

Brand new Beagle Bone A5, updated to 3.2.14. Fresh update and upgrade, PyBBIO fails with the following error message after all dependencies are available per the setup instructions:

root@beaglebone:~/PyBBIO# python setup.py install
running install
running build
running build_py
copying bbio/config.py -> build/lib/bbio
running install_lib
copying build/lib/bbio/config.py -> /usr/lib/python2.7/site-packages/bbio
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
writing byte-compilation script '/tmp/tmpJXdVvy.py'
/usr/bin/python /tmp/tmpJXdVvy.py
Traceback (most recent call last):
File "/tmp/tmpJXdVvy.py", line 10, in
direct=1)
File "/usr/lib/python2.7/distutils/util.py", line 527, in byte_compile
from py_compile import compile
ImportError: No module named py_compile
error: command '/usr/bin/python' failed with exit status 1

alexanderhiam pushed a commit that referenced this issue Jun 22, 2012
@alexanderhiam
Copy link
Member

This is an error I was seeing for a while with an older Angstrom image while using the BBIOServer library, but it wasn't causing any crashes, just printing some annoying warnings. It seems to be caused by the BeagleBone's OpenSSL lacking a few hash types which Python thinks are required. I haven't seen it since I upgraded to a newer Angstrom image a month or so ago, so it didn't even cross my mind that it would interfere with the installation using distutils, but I guess it doesn't pass all the tests.

I put together a quick hack that should hopefully fix this for now while I look for a better solution. It's in the experimental branch for now, and it would be great if you could test it out. To do so, cd to the PyBBIO directory and run:

# git checkout -b experimental remotes/origin/experimental
# python setup.py install

Let me know what the output is.

@GoVirtual
Copy link
Author

Will do.

I am running what I thought was the most recent Angstrom image by simply updating this A5 using opkg update && opkg upgrade

is there another process to get a more recent Angstrom image? I plan on using your library extensively for testing purposes, so I want to be as close to your recommended Angstrom image and kernel release as possible.

Thanks in advance for your help with this, I look forward to contributing to PyBBIO in whatever ways I can.


From: Alexander Hiam [reply@reply.github.com]
Sent: Thursday, June 21, 2012 11:19 PM
To: GP
Subject: Re: [PyBBIO] Most recent PyBBIO fails during installation (#5)

This is an error I was seeing for a while with an older Angstrom image while using the BBIOServer library, but it wasn't causing any crashes, just printing some annoying warnings. It seems to be caused by the BeagleBone's OpenSSL lacking a few hash types which Python thinks are required. I haven't seen it since I upgraded to a newer Angstrom image a month or so ago, so it didn't even cross my mind that it would interfere with the installation using distutils, but I guess it doesn't pass all the tests.

I put together a quick hack that should hopefully fix this for now while I look for a better solution. It's in the experimental branch for now, and it would be great if you could test it out. To do so, cd to the PyBBIO directory and run:

# git checkout -b experimental remotes/origin/experimental
# python setup.py install

Let me know what the output is.


Reply to this email directly or view it on GitHub:
#5 (comment)

@GoVirtual
Copy link
Author

root@beaglebone:~/PyBBIO# git checkout -b experimental remotes/origin/experimental
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'remotes/origin/experimental' which can not be resolved as commit?

@GoVirtual
Copy link
Author

Then after a fresh wipe of PyBBIO and git clone:

root@beaglebone:~/PyBBIO# git checkout -b experimental remotes/origin/experimental
error: Your local changes to the following files would be overwritten by checkout:
bbio/config.py
Please, commit your changes or stash them before you can switch branches.
Aborting

root@beaglebone:/PyBBIO# rm bbio/config.py
root@beaglebone:
/PyBBIO# git checkout -b experimental remotes/origin/experimental
Branch experimental set up to track remote branch experimental from origin.
Switched to a new branch 'experimental'
root@beaglebone:/PyBBIO# python setup.py install
running install
running build
running build_py
copying bbio/config.py -> build/lib/bbio
running install_lib
copying build/lib/bbio/config.py -> /usr/lib/python2.7/site-packages/bbio
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/usr/lib/python2.7/hashlib.py", line 139, in
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
writing byte-compilation script '/tmp/tmpGwbE2h.py'
/usr/bin/python /tmp/tmpGwbE2h.py
Traceback (most recent call last):
File "/tmp/tmpGwbE2h.py", line 10, in
direct=1)
File "/usr/lib/python2.7/distutils/util.py", line 527, in byte_compile
from py_compile import compile
ImportError: No module named py_compile
error: command '/usr/bin/python' failed with exit status 1
root@beaglebone:
/PyBBIO#

@alexanderhiam
Copy link
Member

Alright, I just pushed another commit, so give it a try with:

# git reset --hard
# git pull
# python setup.py install

The issue you had with bbio/config.py is that the setup.py script modifies it to include the absolute path to PyBBIO/libraries/ before trying to install, then changes it back after, but when the installation crashes it never makes it to changing it back. The first command above takes care of this; deleting the file looks like it does the trick, but it won't come back with git pull. reset --hard will make sure your local experimental branch is back to the last commit so there will be no conflicts with git pull.

I'm running 3.2.18, so it's a bit newer than your image. I really don't want the solution to be to wipe your uSD card and start from scratch with a slightly newer image, but if you do want to keep current there's a great tutorial here: http://borderhack.com/?p=1062

@GoVirtual
Copy link
Author

No, same error message as before for some reason.

@alexanderhiam
Copy link
Member

I had a feeling that would happen; I just pushed a new commit, try those same three commands again.

@GoVirtual
Copy link
Author

Looks like that did it!

root@beaglebone:/PyBBIO# python setup.py install
Installing PyBBIO...
Finished!
root@beaglebone:
/PyBBIO#

@GoVirtual
Copy link
Author

Ok, I used your example on the docs page and wired an LED to GPIO1_16 and GND.

The code runs without error, but nothing happens with the LED.

@GoVirtual
Copy link
Author

You know what's weird though, the onboard LED is blinking. Is GPIO1_16 somehow tied to that LED?

@alexanderhiam
Copy link
Member

Thanks for the help on this one, and I'm glad it finally worked for you!

I must have copy and pasted that example from elsewhere, because I said GPIO1_16 but the code used USR3, which is the on-board LED you saw blinking! I just changed it on the wiki page, so what's there now should work for you.

I just merged the fix into the master branch, so you'll want to return to it now with:

# git checkout master
# git reset --hard
# git pull

Which will switch back to the master branch, reset to the last commit (to get config.py back) then pull the new changes.

You might as well run the install script again at this point just to confirm it's working; I'll leave the issue open until then.

@GoVirtual
Copy link
Author

Thanks! I will keep you posted, your library shows a lot of promise.

Have you seen the announcement about the Gooseberry? Your library might be applicable for that platform with minimal porting effort too.

----- Original Message -----
From: Alexander Hiam [mailto:reply@reply.github.com]
Sent: Friday, June 22, 2012 12:18 PM
To: Gregory Perry
Subject: Re: [PyBBIO] Most recent PyBBIO fails during installation (#5)

Thanks for the help on this one, and I'm glad it finally worked for you!

I must have copy and pasted that example from elsewhere, because I said GPIO1_16 but the code used USR3, which is the on-board LED you saw blinking! I just changed it on the wiki page, so what's there now should work for you.

I just merged the fix into the master branch, so you'll want to return to it now with:

# git checkout master
# git reset --hard
# git pull

Which will switch back to the master branch, reset to the last commit (to get config.py back) then pull the new changes.

You might as well run the install script again at this point just to confirm it's working; I'll leave the issue open until then.


Reply to this email directly or view it on GitHub:
#5 (comment)

@GoVirtual
Copy link
Author

Ok I went back to the master repo, then re-installed everything. The onboard LED is not blinking now, but neither is the LED attached to pin 15 on header 9. I just noticed the resistor requirement, I don't have a 300 ohm resistor attached yet; would that prevent the LED from flashing?

@alexanderhiam
Copy link
Member

The purpose of the resistor is to limit the current through the LED, so it's possible that you burned out your LED, but the maximum current sourced by the BeagleBone GPIO pins is so low that I doubt that's the case. 330 ohms is a common value for LEDs, but anything in the range of 100-1k ohms should do the trick. Are you sure you counted right on the header? Have you tried reversing the LED?

@GoVirtual
Copy link
Author

I checked the schematics again and I am an idiot. I had everything wired to P8 instead of P9, now it's working perfectly, thanks for the quick reply.

@alexanderhiam
Copy link
Member

Easy mistake, the labels on the board are pretty tiny!

@zxoch
Copy link

zxoch commented Aug 6, 2012

Dear Alex,

I followed the steps to install PyBBIO v0.4 on the beaglebone Rev. A6 with
The Angstrom Distribution beaglebone ttyO0
Angstrom v2012.05 - Kernel 3.2.18

However, I have the following issue:
root@beaglebone:/PyBBIO# python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in
from distutils.core import setup
ImportError: No module named distutils.core
root@beaglebone:
/PyBBIO#

Any suggestion?
Thanks in advance.

@alexanderhiam
Copy link
Member

My bad, I left out a dependency from the install instructions. Run:

# opkg install python-distutils

Then try again.

I just fixed the instructions.

alexanderhiam pushed a commit that referenced this issue Aug 6, 2012
@zxoch
Copy link

zxoch commented Aug 7, 2012

THANK YOU VERY MUCH. IT WORKS!
root@beaglebone:# opkg install python-distutils
Installing python-distutils (2.7.2-r3.17) to root...
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.05/ipk/eglibc/armv7a/python/python-distutils_2.7.2-r3.17_armv7a.ipk.
Configuring python-distutils.
root@beaglebone:
# cd PyBBIO/
root@beaglebone:~/PyBBIO# python setup.py install
Installing PyBBIO...
Finished!

@jsayles
Copy link

jsayles commented Oct 25, 2012

I think this issue might have resurfaced. I have an A6 board and yesterday (10/24/2012) I did a full update of the OS. Today I tried to compile this package and got the py_compile error.

root@beaglebone:/PyBBIO# uname -a
Linux beaglebone 3.2.30 #1 Wed Oct 17 09:39:19 CEST 2012 armv7l GNU/Linux
root@beaglebone:
/PyBBIO# python setup.py install
Installing PyBBIO...
running install
running build
running build_py
copying bbio/init.py -> build/lib/bbio
copying bbio/bbio.py -> build/lib/bbio
copying bbio/config.py -> build/lib/bbio
running install_lib
copying build/lib/bbio/config.py -> /usr/lib/python2.7/site-packages/bbio
writing byte-compilation script '/tmp/tmpdtc0y9.py'
/usr/bin/python /tmp/tmpdtc0y9.py
Traceback (most recent call last):
File "/tmp/tmpdtc0y9.py", line 10, in
direct=1)
File "/usr/lib/python2.7/distutils/util.py", line 527, in byte_compile
from py_compile import compile
ImportError: No module named py_compile
error: command '/usr/bin/python' failed with exit status 1

@alexanderhiam
Copy link
Member

Thanks, I'll check it out. I don't know distutils very well, so it's possible I'm using it in an outdated way. Does it install when you use # python setup.py -f install ?

@alexanderhiam
Copy link
Member

I just updated setup.py, and it should now actually resolve this issue automatically, instead of just having a flag to bypass distutils.

@GoVirtual
Copy link
Author

Any plans to integrate the PRU with PyBBIO? This would facilitate the same level of precision for GPIO-based PWM as the onboard PWMs with the BeagleBone...

http://elinux.org/ECE497_BeagleBone_PRU


From: Alexander Hiam [notifications@github.com]
Sent: Wednesday, November 07, 2012 2:49 PM
To: alexanderhiam/PyBBIO
Cc: Gregory Perry
Subject: Re: [PyBBIO] Most recent PyBBIO fails during installation (#5)

I just updated setup.py, and it should now actually resolve this issue automatically, instead of just having a flag to bypass distutils.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-10162219.

@alexanderhiam
Copy link
Member

Eventually I'd like to have some sort of support for the PRU, but there's a lot I want to get done before I get into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants