aldebaran / libqi-python

qiSDK python bindings
BSD 3-Clause "New" or "Revised" License
15 stars 11 forks source link

Pip package doesn't have a matching distribution #10

Closed saya-rbt closed 3 years ago

saya-rbt commented 3 years ago

Hello,

When trying to install qi through pip, I get this error:

$ pip install qi
ERROR: Could not find a version that satisfies the requirement qi (from versions: none)
ERROR: No matching distribution found for qi

The wheel apparently uses CPython 3.5, but I'm using Python 3.9.7.

I find it weird that the Python version is so outdated, when the package has been updated a month ago. I do realize that the Python requirement is listed as ~=3.5, but why? Isn't there a more up-to-date version?

I tried building it myself but I get so many different errors that I could open an entire other issue with them, and that's not the point, I just want to be able to use qi simply :disappointed:

Is there anything I could do?

Thanks

nyibbang commented 3 years ago

Hello @saya-rbt ,

We're currently building the package on Linux x86_64 for CPython 3.5 only. We're aware that this is a big limitation but we're short-staffed and we don't currently have the means to build and release for each of the major Python versions (3.5+) on each of the major operating systems.

If you give me more details (which version of the module, for which OS and Python version), I can try building it for you and upload it when I get the time. Although, you might just be better off building it directly, even if I admit it is a bit of a hassle.

saya-rbt commented 3 years ago

Hello @nyibbang,

Thank you for your message. I understand the struggles you might be facing, and it's very nice of you to offer to build a version for me. I would like to use the latest possible version for Linux on Python 3.9, or if you can, 3.10 so it could be even more future-proof (but since it has been released 2 weeks ago I'd understand if it's not possible).

I've tried building it directly but got a lot of errors, regarding the nonexistence of qibuild or an error such as Could NOT find Python (missing: Python_EXECUTABLE Development Interpreter) (found suitable version "3.9", minimum required is "3.9"). I will try again tomorrow and keep you updated on how I do.

Thank you very much for your work!

nyibbang commented 3 years ago

Hello @saya-rbt,

I built a wheel of libqi-python v3.0.0 for Python 3.10 on Linux x84_64. It's available in the releases or directly here. Could you try it ?

saya-rbt commented 3 years ago

Thank you very much. I've tried it (note: I use pyenv to run different versions of Python on different projects, but that shouldn't interfere with anything. I'm specifying this so that the file paths mentioned make more sense) on Python 3.10.0 using Arch Linux x86_64.

The wheel installs without any issue:

$ pip install qi-3.0.0-cp310-cp310-linux_x86_64.whl
Processing ./qi-3.0.0-cp310-cp310-linux_x86_64.whl
Installing collected packages: qi
Successfully installed qi-3.0.0

However, when importing the library, I get this issue:

$ python
Python 3.10.0 (default, Oct 25 2021, 11:49:37) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import qi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/saya/.pyenv/versions/3.10.0/lib/python3.10/site-packages/qi/__init__.py", line 9, in <module>
    from packaging import version
ModuleNotFoundError: No module named 'packaging'

I installed packaging through pip install packaging then tried again, and this time got another error:

$ python
Python 3.10.0 (default, Oct 25 2021, 11:49:37) [GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import qi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/saya/.pyenv/versions/3.10.0/lib/python3.10/site-packages/qi/__init__.py", line 19, in <module>
    from .qi_python \
ImportError: libicui18n.so.66: cannot open shared object file: No such file or directory

Also, I tried building the package myself, but the version of Boost I have installed on my system is 1.76 and not 1.64. Therefore, I passed the variable -DBOOST_VERSION=1.76, but it could not compile since the way Bind placeholders work has changed in Boost 1.73. I get an error at compilation saying /usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’, followed by a lot of other errors related to this one. I therefore understood that libqi required changes to the includes in order to fit that behavior, but I have neither the time nor knowledge to do the changes myself and use LIBQI_GIT_REPOSITORY to point to my own changes.

I also tried simply installing a Python 3.5.9 version using pyenv and then doing pip install qi, and the package installed correctly and imports properly. Therefore, if you don't have time/want to deal with my specific problem, I can fallback to this solution instead.

nyibbang commented 3 years ago

Okay, thank you for your feedback. I'll try to fix the packing module and the libicu issues, and reupload the package.

Concerning Boost 1.76, we're looking into porting to this version soon-ish, and we've encountered the errors about boost::bind you mentioned. We're working on it but I don't know when it will be released.

nyibbang commented 3 years ago

@saya-rbt I have updated the wheel for Python 3.10. Hopefully the issues you had before have been fixed.

saya-rbt commented 3 years ago

@nyibbang It works perfectly! I could import it without any issue and run some basic code with it.

Thank you so much for your time, availability and expertise. I genuinely cannot thank you enough because of how helpful you were. Out of curiosity, will you make the code changes you had to do available? In the event I would need to recompile it myself (not in the near future, but later).

Also, will you be uploading this working wheel to PyPI? I'm sure it would be useful, plus it would make it easier to integrate in a requirements.txt file.

Again, thank you so much for your help!!

nyibbang commented 3 years ago

Yes, I intend to push them as soon as they've been reviewed with my team. They're mainly changes to the CMake/setup.py code. I'll have to ask the person in charge of the company PyPI account if we can upload it, as I personally don't have the logins for it.