Opened 4 years ago

Last modified 41 hours ago

#59930 assigned defect

Byobu attempts to load system Python3

Reported by: jenstroeger (Jens Troeger) Owned by: l2dy (Zero King)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: byobu

Description

I’ve installed byobu to play around with it, but receive the following error:

> byobu
/opt/local/bin/byobu-select-session: /opt/local/lib/byobu/include/select-session.py: /usr/bin/python3: bad interpreter: No such file or directory
/opt/local/bin/byobu-select-session: line 24: /opt/local/lib/byobu/include/select-session.py: Undefined error: 0

Looks like it tries to run the system’s Python3 interpreter (which ships only with 2.7) instead of MacPorts’ interpreter.

Change History (5)

comment:1 Changed 4 years ago by jenstroeger (Jens Troeger)

Addendum:

> sudo vim /opt/local/lib/byobu/include/select-session.py

and changing the first line to

#!/usr/bin/env python3

worked.

comment:2 Changed 4 years ago by reneeotten (Renee Otten)

Milestone: MacPorts 2.7.0
Owner: set to l2dy
Status: newassigned

comment:3 Changed 4 years ago by l2dy (Zero King)

The libnewt port with python support compiled is required for the python part of byobu to function. But this port is built --without-python. So even if byobu properly loads Python from MacPorts, it would not have the required module.

byobu-5.130/usr/lib/byobu/include/constants

# Find a suitable python interpreter, if undefined
if [ -z "$BYOBU_PYTHON" ]; then
	if python3 -c "import snack" >/dev/null 2>&1; then
		export BYOBU_PYTHON="python3"
	elif python2 -c "import snack" >/dev/null 2>&1; then
		export BYOBU_PYTHON="python2"
	elif python -c "import snack" >/dev/null 2>&1; then
		export BYOBU_PYTHON="python"
	fi
fi

We need to package py-newt first.

comment:4 Changed 4 years ago by reneeotten (Renee Otten)

see also ticket:44044

Last edited 43 hours ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:5 in reply to:  3 Changed 41 hours ago by ryandesign (Ryan Carsten Schmidt)

Replying to l2dy:

We need to package py-newt first.

But calling libnewt's python modules py-newt would be wrong. That name should be reserved for the unrelated package at https://pypi.org/project/newt/

Note: See TracTickets for help on using tickets.