Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Runs the system-installed Python #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
probonopd opened this issue Jun 9, 2019 · 4 comments · May be fixed by #41
Open

Runs the system-installed Python #25

probonopd opened this issue Jun 9, 2019 · 4 comments · May be fixed by #41

Comments

@probonopd
Copy link
Contributor

probonopd commented Jun 9, 2019

If we bundle a script that uses !/usr/bin/env python, then we end up running the system-installed Python rather the bundled one. We need some sort of a wrapper to set up $PATH at least.

wget -c "https://raw.githubusercontent.com/TheAssassin/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh"
wget -c "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
chmod +x linuxdeploy-x86_64.AppImage linuxdeploy-plugin-conda.sh

wget -c "https://raw.githubusercontent.com/probonopd/ptouch-770/patch-1/ptouch-770.desktop"
cp /usr/share/icons/gnome/256x256/devices/printmgr.png .
rm -rf ./_temp_home AppDir/ || true
mkdir -p AppDir/usr/bin
wget -c "https://raw.githubusercontent.com/probonopd/ptouch-770/patch-1/ptouch-770-gui" -O AppDir/usr/bin/ptouch-770-gui
chmod +x AppDir/usr/bin/*

export CONDA_CHANNELS=ostrokach CONDA_PACKAGES=gtk;pil;pyusb

./linuxdeploy-x86_64.AppImage --appdir AppDir -d ptouch-770.desktop  --plugin conda --output appimage -i printmgr.png 

./P-touch_P700_Labels-x86_64.AppImage
@TheAssassin
Copy link
Member

TheAssassin commented Jun 9, 2019

Duplicate of/related to #12.

This can't be done simply, since we cannot guess the path of the Python installation in the AppDir, the paths in shebangs are either absolute or it's about things in $PATH, as you stated. Can you evaluate other commands or environment variables in a shebang? Then $APPDIR/usr/bin/python or $(readlink -f .)/python or so might work.

@TheAssassin
Copy link
Member

As stated in #12, Python scripts should never call each other "directly", as that's anything but portable. And for running at first, python -m "name_of_module" is usually good enough.

If either of the solutions above works (I'd favor the $APPDIR one) that'd be a great step forward and we could also fix #12 with that.

@probonopd
Copy link
Contributor Author

I think we need some sort of AppRun, no?

@TheAssassin
Copy link
Member

Yes, it's needed with this. But the solution is not really to export any variables. That only works when the shebang uses /usr/bin/env or doesn't specify an absolute path altogether. The proper solution for #12 would be to replace the shebangs, and that likely also makes the need for an AppRun obsolete so it could solve #25, too.

knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
@knarfS knarfS linked a pull request Jun 11, 2021 that will close this issue
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 12, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 12, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 13, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 25, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants