velolala / touchosc2midi

a (linux compatible) TouchOSC Midi Bridge written in python
MIT License
111 stars 22 forks source link

Support for Python3 #19

Open riban-bw opened 5 years ago

riban-bw commented 5 years ago

Python 2 goes out of support at end of 2019. Python Software Foundation are recommending update to Python 3. Please consider updating touchosc2midi to support being run by Python 3 interpreter.

mikobuntu commented 4 years ago

+1 for Python3 support. Right now using Ubuntu20.04 I am unable to build touchosc2midi. thanks

velolala commented 3 years ago

I agree! Any takers?

reactorcoremeltdown commented 3 years ago

@velolala

So I've had some success, but I am not sure how to proceed with merging my changes back to the upstream & getting it uploaded to pypi.

I am not a professional python developer, I just wanted to make it work on my Pi Zero W, so I could finally connect TouchOSC to my guitar FX processor.

Please proceed with care.

https://github.com/reactorcoremeltdown/touchosc2midi#a-few-notes-on-this-fork

PA3FUN commented 3 years ago

Hi reactorcoremeltdown. I'm not a complete newbee, and could use some help installing Velolala's touchosc2midi on my Ubuntu 20.02 LTS desktop. Please see below the error thrown when I follow your guideline. Any help appreciated!

christiaan@CJR-M92p:~/touchosc2midi$ pip3 install -r requirements.txt Defaulting to user installation because normal site-packages is not writeable Collecting pyliblo-0.10.0 Cloning https://github.com/dsacre/pyliblo.git (to revision 33999ca8178a01c720e99856df769f1986c7e912) to /tmp/pip-install-b_4reted/pyliblo-0-10-0_f25f9495cc9b439e81dfe4a9f35c46ca Running command git clone --filter=blob:none -q https://github.com/dsacre/pyliblo.git /tmp/pip-install-b_4reted/pyliblo-0-10-0_f25f9495cc9b439e81dfe4a9f35c46ca Running command git rev-parse -q --verify 'sha^33999ca8178a01c720e99856df769f1986c7e912' Running command git fetch -q https://github.com/dsacre/pyliblo.git 33999ca8178a01c720e99856df769f1986c7e912 Resolved https://github.com/dsacre/pyliblo.git to commit 33999ca8178a01c720e99856df769f1986c7e912 Preparing metadata (setup.py) ... done WARNING: Generating metadata for package pyliblo-0.10.0 produced metadata for project name pyliblo. Fix your #egg=pyliblo-0.10.0 fragments. WARNING: Discarding git+https://github.com/dsacre/pyliblo.git@33999ca8178a01c720e99856df769f1986c7e912#egg=pyliblo-0.10.0. Requested pyliblo from git+https://github.com/dsacre/pyliblo.git@33999ca8178a01c720e99856df769f1986c7e912#egg=pyliblo-0.10.0 (from -r requirements.txt (line 1)) has inconsistent name: filename has 'pyliblo-0-10-0', but metadata has 'pyliblo' ERROR: Could not find a version that satisfies the requirement pyliblo-0-10-0 (unavailable) (from versions: none) ERROR: No matching distribution found for pyliblo-0-10-0 (unavailable

reactorcoremeltdown commented 3 years ago

@PA3FUN

So we were able to troubleshoot all problems with python3 setup in a private conversation. Thanks for a nice chat, Christiaan!

What also bothers me a little here is that pyliblo is quite outdated, I'll see on a clean machine if it's possible to upgrade the library.

After all this made clear, I'll need a hand to get it merged to the upstream.

Thanks everyone!

digitalsignalperson commented 1 year ago

I'm running this on arch linux, using the latest python packages from the main repo (except for mido, installed via pip).

These are the changes I needed to make, and it seems to be working for me

diff --git a/touchosc2midi/advertise.py b/touchosc2midi/advertise.py
index 1a8fa1e..d7479f1 100755
--- a/touchosc2midi/advertise.py
+++ b/touchosc2midi/advertise.py
@@ -37,7 +37,7 @@ def build_service_info(ip):
                            socket.gethostname(),
                            TOUCHOSC_BRIDGE
                        ),
-                       address=socket.inet_aton(ip),
+                       addresses=[socket.inet_aton(ip)],
                        port=PORT,
                        properties=dict(),
                        server=socket.gethostname() + '.local.')
@@ -86,7 +86,7 @@ class Advertisement(object):
     def get_ip(self):
         """:return: the service's IP as a string.
         """
-        return socket.inet_ntoa(self.info.address)
+        return socket.inet_ntoa(self.info.addresses[0])

     ip = property(get_ip)