View my account

Python 3 bindings.

Comments

5 comments

  • MartyG

    Python 3.7 support was added in SDK version 2.23.0, the version before the one that you are using (2.24.0).

    https://github.com/IntelRealSense/librealsense/issues/4515 

    The official instructions for building Python with Windows are here:

    https://github.com/IntelRealSense/librealsense/tree/master/wrappers/python#windows 

    As you mentioned, the instructions state that the pre-built binaries assume Python 2.7, and give the error message that you encountered if you are using Python 3.

    I do not have any information about if / when Python 3 binaries will be made available, unfortunately.

    0
    Comment actions Permalink
  • Rapanui444

    I am very surprised that you are making every customer that wants to use these wrappers build them! Wouldn't be better for you to supply them? You currently supply only the outdated Python 2.7. Why?

    Users that want to write Python scripts do NOT want to jump through all of the hoops of installing Visual Studio, and executing cmake just to get the bindings to use their preferred language. I understand that you can't provide everything to everyone, but it would be useful if you covered the large user bases like Windows 10 and common Linux.

    This is particularly upsetting since the marketing literature touts Python support.

    Making this easy to use will certainly increase sales and adoption.

    0
    Comment actions Permalink
  • MartyG

    RealSense aims to be usable on as many hardware devices and operating systems as possible, and include a minimum number of default dependencies in the SDK (as a lot of dependencies could make the SDK more difficult to integrate into existing customer setups and increase the size of its installation "footprint").  It provides a slim core installation by default whilst enabling its users to install exactly what they need, and only what they need.

    This does naturally have an impact on the ease of setup in situations where additional bindings such as pyrealsense2 need to be added.  The easiest way to add bindings is to include them in the CMake build statement whilst building Librealsense, or to add them later with CMake by building only the binding and not Librealsense.

    Python 3 is actually supported by pyrealsense2.  Whilst it is true that the pre-built binary installer for Windows installs a Python binding with examples configured for Python 2.7, you can install Python 3 compatible bindings by building the pyrealsense2 wrapper from source code or by installing with PyPi ("pip" install).

    0
    Comment actions Permalink
  • Rapanui444

    Thank you for the response.

    I previously tried pip install pyrealsense2. This did not work at all.

    I had previously also tried the pip install after downloading the wheel file from PyPI with no success. I discovered, however, that I needed to install python 3.7 (it will not work with 3.8) and use the following specific command (substituting the actual path on my machine for <path to my installation>):

     

    <path to my installation>python -m pip install pyrealsense2-2.36.0.2038-cp37-cp37m-win_amd64.whl

     

    Once I did this, the library was installed and available for use with Python 3.7

    0
    Comment actions Permalink
  • MartyG

    You are correct, for now Python 3.8 users currently need to build pyrealsense2 from source instead of using pip.  I filed an official feature request with Intel last month for Python 3.8 support for PyPi installation though so they could look at the possibility of providing it.  Thanks so much for the update!

    0
    Comment actions Permalink

Please sign in to leave a comment.