Python is broken after installing entware

This is probably a very simple fix, but I installed pyload via entware, which works, however, it may have actually broken the links to the existing python modules.

How can i restore them back.

I keep getting “Could not find platform in dependant libraries consider setting $PYTHONHOME to …”

I can’t do simple things that require python. Can’t imagine what other things it has broken in the system.

Can’t call python scripts or kodi-send commands

Can you tell exactly how to reproduce this issue?

I think i have identified the issue. when I echo $path i see opt/bin as the first items. I want to change it or remove it permanently, but I cannot find ~./profile

To replicate, simply install pyload

opkg install pyload

for whatever reason, it installs python as well under opt directory.

Look the file /opt/etc/profile.

Okay here it is:

#Please note it's not a system-wide settings, it's only for a cu
rrent
# terminal session. Point your f\w (if necessery) to execute /opt
/etc/profile
# at console logon.

is_substring(){
    case "$2" in
        *$1*) return 0;;
        *) return 1;;
    esac
}

# Set CHECK_OPT_PATH to 1 to check /opt/bin and /opt/sbin in PATH
CHECK_OPT_PATH=0
if [ $CHECK_OPT_PATH = 1 ]; then
    is_substring "/opt/bin" $PATH
    [ $? == 1 ] && export PATH=/opt/bin:$PATH
    is_substring "/opt/sbin" $PATH
    [ $? == 1 ] && export PATH=/opt/sbin:$PATH
else
    export PATH=/opt/bin:/opt/sbin:$PATH
fi
export TERMINFO=/opt/share/terminfo
export TERM=xterm
export TMP=/opt/tmp
export TEMP=/opt/tmp
unset LD_PRELOAD
unset LD_LIBRARY_PATH
alias mc="mc -c"

# You may define localization
#export LANG='ru_RU.UTF-8'
#export LC_ALL='ru_RU.UTF-8'
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'

Assuming i need to change the /opt/bin:$PATH to $PATH:/opt/bin

EDIT: I renamed the file profile to profile.bak and opened a session again. And looks like everything was back to normal, except opkg bits.

I think this needs to be put in the entware upon install, that it references existing libraries first rather than replacing with its own.

EDIT2:

Out of my depth here. I am not sure how to have both entware and not break ssh sessions. cant use curl either. Curl says version not available and then points to service.plexmediaserver as the error. No issues when the profile doesn’t exist.

Well, one option would be to use entware stuff only when you need it.
Move it’s profile

mv /opt/etc/profile /opt/etc/profile_orig`

and when you need to run something from it source profile

. /opt/etc/profile_orig
some_entware_command

Sounds good. But some entware stuff runs in the background. For example pyload, zerotier etc… will they still continue to run?

It is starting to make sense now. When I tried to add zerotier to an autostart script it just wouldnt work. I would still have to manually start it. Seeing as this only gets loaded and is terminal specific rather than system wide it won’t effect already existing programs.

1 Like