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 is not supported #13

Open
hsamuels0 opened this issue Nov 15, 2017 · 0 comments
Open

Python3 is not supported #13

hsamuels0 opened this issue Nov 15, 2017 · 0 comments

Comments

@hsamuels0
Copy link

I'm running this on a Arch Linux. Arch uses python3 as default python version. This means all when running the commands in the install.sh python3 is used. This causes an exception when you start the antifier.py.

+++
[shell]$ sudo python antifier.py
File "antifier.py", line 454
if debug:print "get ant stick"
^
SyntaxError: Missing parentheses in call to 'print'
+++

This error is caused by the change in print statement that requires a '()' around the print for ex 'print ("get ant stick")'. This should be easy to fix and as far as I know support later python2 releases. When that is done the antifier GUI starts, but when connecting the USB from the Tacx trainer, another exception shows up. So there is more things that needs fixing to make this python3 compatible. I'm not skilled enough to judge how much work that is and if that also would break python2 compatibility.

The simple solution for Arch linux is to use the 'python2' commands and start it under python2. No changes needed to the code.

Here is what you need to do:
'sudo pacman -S python2-pip tk'
'pip2 install pyserial pyusb numpy'
As the install script will fail initializing python2 and add all this to python3 (which you do not need), it is probably easiest to just pull the whole antifier directory from github. If you do this with 'hub' it will be easy to keep the directory up to date as code progress.
'sudo pacman -S hub'
'hub clone https://github.com/john-38787364/antifier'
A simple 'hub pull' when you are in the antifier directory will now update to latest version.
Last step is to start antifier.py with python2. When you are in the antifier directory you do:
'sudo python2 antifier.py'

I have not worked with other distros in a while, but my assumption is that they have similar solutions to install and use python2, if they have already moved to Python3 as default python version.

I would suggest to add some information to the README or add a README_PYTHON3 with some suggestions if others run in to this.

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

1 participant