Opened 14 months ago

Last modified 14 months ago

#58666 assigned defect

py36-pyside2 - problem with pyside2-rcc

Reported by: cainesi Owned by: pmetzger (Perry E. Metzger)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: py-pyside2

Description (last modified by mf2k (Frank Schima))

"pyside2-rcc-3.6" script does not execute correctly.

The script is correctly installed in /opt/local/bin, but when run it does not correctly find the pyside2-rcc script in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PySide2/, instead it appears to be looking for pyside2-rcc-3.6 in that location.

Example error when pyside2-rcc-3.6 command is run:

Traceback (most recent call last):

  File "/opt/local/bin/pyside2-rcc-3.6", line 11, in <module>
    load_entry_point('PySide2==5.12.3', 'console_scripts', 'pyside2-rcc')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PySide2/scripts/pyside_tool.py", line 50, in main
    sys.exit(subprocess.call(command))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PySide2/scripts/../pyside2-rcc-3.6': '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PySide2/scripts/../pyside2-rcc-3.6'

Change History (6)

comment:1 Changed 14 months ago by cainesi

Description: modified (diff)

comment:2 Changed 14 months ago by jmroot (Joshua Root)

Cc: MarcusCalhoun-Lopez added
Owner: set to pmetzger
Status: newassigned

comment:3 Changed 14 months ago by mf2k (Frank Schima)

In the future, please use WikiFormatting.

comment:4 Changed 14 months ago by mf2k (Frank Schima)

Description: modified (diff)
Port: py-pyside2 added; py36-pyside2 removed

comment:5 Changed 14 months ago by pmetzger (Perry E. Metzger)

I might be the owner on this but I'm remarkably ill equipped to debug it. My understanding of what's going on behind the scenes for pyside is minimal.

comment:6 Changed 14 months ago by cainesi

I think I have figured out the problem.

1) build_scripts/config.py (around line 200) defines entry points for pyside2-uic, pyside2-rcc, and pyside2-lupdate. I assume the python.versions variable in the portfile causes appropriately renamed versions of those entry points (i.e., appending "-3.6" or whatever) to be put in the Macports bin directory.

2) The entry points for rcc and lupdate are a bit funny--they do not actually point at python files that implement the relevant commands. Instead they point at pyside_tool.py. What that script does is look at sys.argv to figure out what command was invoked, and then tries to run an executable file with the same name in a certain directory. I.e., it relies on the name of the file where the entry point is invoked being the same as the name as the executable that is supposed to be run (seems like a fragile approach...). This is broken by the renaming that happened in item 1 above. (pyside2-uic-py36 does not go through pyside_tool.py and does not have this problem).

Not sure what the best way to fix this is? I suppose we could just replace pyside2-rcc-py36 and pyside2-lupdate-py36 in bin with links to the relevant executables?

Note: See TracTickets for help on using tickets.