ideoforms / pylive

Query and control Ableton Live from Python
505 stars 66 forks source link

liblo/cython issues #21

Closed kodokoto closed 3 years ago

kodokoto commented 3 years ago

Hello, I successfully installed cython via pip3 and liblo via brew as recommended in the readme, and I also installed pylive via pip3.

But when I try running setup.py I get this error:

WARNING: The wheel package is not available.
Warning: 'keywords' should be a list, got type 'tuple'
running pytest
Searching for pyliblo>=0.9.1
Reading https://pypi.org/simple/pyliblo/
Downloading https://files.pythonhosted.org/packages/c0/da/4b8052ab5aa07952d7fe7b068d737a042e76373573eadd340f7550eddea9/pyliblo-0.10.0.tar.gz#sha256=fc67f1950b827272b00f9f0dc4ed7113c0ccef0c1c09e9976dead40ebbf1798f
Best match: pyliblo 0.10.0
Processing pyliblo-0.10.0.tar.gz
Writing /var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.cfg
Running pyliblo-0.10.0/setup.py -q bdist_egg --dist-dir /var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/egg-dist-tmp-s2v9mioq
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.py", line 20, in <module>
    # way! + try to find workaround so cython gets installed first if not
ModuleNotFoundError: No module named 'Cython'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/setup.py", line 5, in <module>
    setup(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 202, in run
    installed_dists = self.install_dists(dist)
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 153, in install_dists
    orig.test.install_dists(dist), self.install_extra_dists(dist)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/test.py", line 209, in install_dists
    ir_d = dist.fetch_build_eggs(dist.install_requires)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
    resolved_dists = pkg_resources.working_set.resolve(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 779, in resolve
    dist = best[req.key] = env.best_match(
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1064, in best_match
    return self.obtain(req, installer)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1076, in obtain
    return installer(requirement)
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/pylive/.eggs/pytest_runner-5.3.0-py3.9.egg/ptr.py", line 84, in fetch_build_egg
    return cmd.easy_install(req)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 686, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 712, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 897, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 1167, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/command/easy_install.py", line 1151, in run_setup
    run_setup(setup_script, args)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 253, in run_setup
    raise
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 166, in save_modules
    saved_exc.resume()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 141, in resume
    six.reraise(type, exc, self._tb)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/_vendor/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 154, in save_modules
    yield saved
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 195, in setup_context
    yield
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 250, in run_setup
    _execfile(setup_script, ns)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/sandbox.py", line 45, in _execfile
    exec(code, globals, locals)
  File "/var/folders/3_/kmf5dynn0x39j4pjymr2kcvh0000gn/T/easy_install-66qqpjal/pyliblo-0.10.0/setup.py", line 20, in <module>
    # way! + try to find workaround so cython gets installed first if not
ModuleNotFoundError: No module named 'Cython'

and if i try running a simple script that changes the live sets tempo i get this error:

/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/yoink.py"
Traceback (most recent call last):
  File "/Users/modii/Dropbox/Development/Ableton/stealing altiverb/yoink.py", line 1, in <module>
    import live
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/__init__.py", line 34, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/set.py", line 6, in <module>
  File "<frozen zipimport>", line 259, in load_module
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pylive-0.2.1-py3.9.egg/live/query.py", line 48, in <module>
ModuleNotFoundError: No module named 'liblo'
kodokoto commented 3 years ago

Fixed it using

python3 -m pip install cython
python3 -m pip install pylive
ideoforms commented 3 years ago

Thanks for the feedback @kodokoto!

Just so I can better understand the scenario for future reference, would you mind pasting the output of the following commands for me?

ls -al `which python3`
ls -al `which pip3`

Thanks.

kodokoto commented 3 years ago
ls: which python3: No such file or directory

~
➜ ls -al 'which pip3'
ls: which pip3: No such file or directory

There is a big chance that it stems from my python installation being weird.

ideoforms commented 3 years ago

I think you're probably right. But, it's quite easy to end up with a weird Python install, so I'm keen to do everything I can to understand and guard against it.

Those quotes should be backticks (`), not single quote marks (') - mind copy and pasting the original commands? You should get an output that shows where the python3/pip3 symlinks point to.

kodokoto commented 3 years ago

Ah my bad that is the output

➜ ls -al `which pip3`
lrwxr-xr-x  1 modii  admin  35 11 Apr 11:30 /usr/local/bin/pip3 -> ../Cellar/python@3.9/3.9.4/bin/pip3

~
➜ ls -al `which pip3`

lrwxr-xr-x  1 modii  admin  35 11 Apr 11:30 /usr/local/bin/pip3 -> ../Cellar/python@3.9/3.9.4/bin/pip3
ideoforms commented 3 years ago

Aha, I think I can see the issue and it is something that I should fix.

Can you run one last one:

ls -l `which python`
kodokoto commented 3 years ago

Yes, sorry for the late reply

➜ ls -l `which python`

lrwxr-xr-x  1 root  wheel  75  1 Jan  2020 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
ideoforms commented 3 years ago

That was really useful, I've fixed the setup.py to ensure it always uses the python3 binary to ensure the above doesn't happen again. Thanks for taking the time to help!