coin3d / pivy

python bindings to coin3d
ISC License
53 stars 37 forks source link

Detecting abnormal qmake install locations #61

Closed kkremitzki closed 3 years ago

kkremitzki commented 4 years ago

David Daish created an issue 2019-02-14

When running setup.py build, the script fails with a somewhat unhelpful error message, if distutils.spawn.find_executable() cannot find the qmake executable:

root@9e855bfad5db:/tmp/pivy# python3 setup.py build 
Traceback (most recent call last):
  File "setup.py", line 96, in <module>
    class pivy_build(build):
  File "setup.py", line 168, in pivy_build
    QTINFO = qtinfo.QtInfo()
  File "/tmp/pivy/qtinfo.py", line 14, in __init__
    getattr(self, thing)
  File "/tmp/pivy/qtinfo.py", line 32, in getLibsExecsPath
    return self.getProperty("QT_INSTALL_LIBEXECS")
  File "/tmp/pivy/qtinfo.py", line 68, in getProperty
    self._dict[prop_name] = self._getProperty(prop_name)
  File "/tmp/pivy/qtinfo.py", line 57, in _getProperty
    proc = subprocess.Popen(cmd, stdout = subprocess.PIPE, shell=False)
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1205, in _execute_child
    executable = os.fsencode(executable)
  File "/usr/lib/python3.5/os.py", line 862, in fsencode
    raise TypeError("expect bytes or str, not %s" % type(filename).__name__)
TypeError: expect bytes or str, not NoneType

This is solved if you instantiate QtInfo with the qmake_command named argument, like this:

qtinfo.QtInfo(qmake_command=["/usr/local/Qt-5.12.2/bin/qmake"])

However, the setup.py script offers no way to do this from the command line. You have to edit the file itself, which is annoying when installing pivy from a script.

As an alternative, I recommend offering the ability to add a command line argument, along the lines of:

python3 setup.py install --qmake_path /usr/local/Qt/bin/qmake

Comments (2)

    David Daish reporter

    Also, this was discovered on tag 0.6.4
        2019-02-14
    Florian Franzen

    If qmake can be found on your current PATH, it should be detected correctly automatically.
looooo commented 3 years ago

This isn't part of the cmake-configuration anymore. So closing this one.