Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2550

[python-binding] setup.py install does not create module directory when using --prefix

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • python-binding
    • None

    Description

      After building proton, installing the python bindings using the generated setup.py does not create all of the necessary directories when used with the --prefix option. In particular, a directory using the module name proton is missing.

      The following install command from the cmake build directory:

      $ export PYTHONPATH=/tmp/lib64/python3.10/site-packages
      $ cd python/dist/
      $ python setup.py install --prefix /tmp
      $ ls -l /tmp/lib64/python3.10/site-packages/
      total 3
      -rw-rw-r--. 1 kvdr kvdr  57 May 26 11:58 easy-install.pth
      drwxrwxr-x. 5 kvdr kvdr 160 May 26 11:58 python_qpid_proton-0.38.0.dev0-py3.10-linux-x86_64.egg
      

      produces a single python_qpid_proton-0.38.0.dev0-py3.10-linux-x86_64.egg directory (and a easy-install.pth file if the PYTHONPATH is set prior to the install).

      This is insufficient to use module proton, even with the PYTHONPATH set:

      $ cd ~ # Exit from dist directory which contains python install artifacts
      $ echo $PYTHONPATH
      /tmp/lib64/python3.10/site-packages
      $ python
      >>> import proton
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      ModuleNotFoundError: No module named 'proton'
      >>> 
      

      However, a workaround exists by adding a symbolic link proton pointing to the .egg directory:

      $ cd /tmp/lib64/python3.10/site-packages/
      $ ln -s python_qpid_proton-0.38.0.dev0-py3.10-linux-x86_64.egg proton
      $ cd ~ # Exit from dist directory which contains python install artifacts
      $ python
      >>> import proton
      >>> proton.__path__
      _NamespacePath(['/tmp/lib64/python3.10/site-packages/proton'])
      

      Attachments

        Activity

          People

            astitcher Andrew Stitcher
            kpvdr Kim van der Riet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: