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

Python3 Support #77

Closed
ash73 opened this issue Feb 12, 2017 · 6 comments
Closed

Python3 Support #77

ash73 opened this issue Feb 12, 2017 · 6 comments

Comments

@ash73
Copy link

ash73 commented Feb 12, 2017

Issue Report

Description

When using omxplayer-wrapper with Python 3 I get the error:
No module named 'omxplayer'

I saw a previous (closed) thread that suggested:
sudo apt-get install python3-dbus

But it makes no difference for me, I still get the same error.

Problem reproduction

git clone https://github.com/willprice/python-omxplayer-wrapper
sudo apt-get install python-dbus
sudo apt-get install python3-dbus
cd python-omxplayer-wrapper
sudo python setup.py install
reboot

Then load and run the sample in Python 3.

Environment details

Raspbian on Pi2.

TIA.

@willprice
Copy link
Owner

Python 3 isn't officially supported, although some people have fiddled with a few lines and got it to work, you're invoking setup.py with python which on raspbian is python2 not python3, so you should be running python3 setup.py install instead.

Have a look at #66 for more details

@ash73
Copy link
Author

ash73 commented Feb 12, 2017

Thanks, took a while as a noob to decipher #66, full sequence is:

git clone https://github.com/willprice/python-omxplayer-wrapper
sudo apt-get install python3-dbus
cd python-omxplayer-wrapper
sudo nano omxplayer/player.py

search for import urlparse change to
import urllib.parse

search for def _setup_omxplayer_process change second line to
source_url = urllib.parse.urlsplit(source)

search for return long(self._get_properties_interface().Duration())
replace long( ) with int( )

sudo python3 setup.py install

@willprice
Copy link
Owner

Cool, thanks for providing the steps in sequence for someone else looking how to do this. When I eventually get around to making this compatible for both py2 and py3 I'll refer back to this.

@willprice
Copy link
Owner

Python 3 support has been implemented in https://github.com/willprice/python-omxplayer-wrapper/tree/python_2_3_support

I need beta testers to see whether this works with their applications. Ideally please also run the smoke tests and report any issues.

@willprice willprice reopened this Apr 17, 2017
@willprice willprice changed the title no module named 'omxplayer' in Python 3 Python3 Support Apr 17, 2017
@willprice
Copy link
Owner

Completed in 809614b

If problems arise on py3 and not py2 or vica versa, please do file an issue.

@SPFXUNLIMITED
Copy link

SPFXUNLIMITED commented Oct 25, 2017

No module named 'omxplayer'
RP3

Link is dead: https://github.com/willprice/python-omxplayer-wrapper/tree/python_2_3_support

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

No branches or pull requests

3 participants