linuxdeploy/linuxdeploy-plugin-conda

"$APPDIR"/usr/conda//lib/python3.7/site-packages does NOT support .pth files

probonopd opened this issue · 3 comments

#! /bin/bash

sudo apt -y install git imagemagick

export VERSION=$(wget -q "https://api.github.com/repos/trufont/trufont/commits?sha=master" -O - | grep sha | head -n 1 | cut -d '"' -f 4 | head -c 7
)

export APPNAME=trufont
export PIP_REQUIREMENTS="-e git+https://github.com/trufont/trufont@wx#egg=$APPNAME fs"
export CONDA_PACKAGES="wxpython " # Only use this if the app is in a Conda channel (e.g., conda-forge)

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

rm -r AppDir || true

cat > $APPNAME.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=TruFont
Exec=trufont %U
Terminal=false
Type=Application
Icon=$APPNAME
Categories=Graphics;
EOF

cat > AppRun <<\EOF
#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
exec "$HERE/usr/conda/bin/python" "$HERE/usr/conda/bin/trufont" "$@"
EOF
chmod +x AppRun

wget -c "https://github.com/trufont/trufont/raw/master/Lib/trufont/resources/app.png"
convert app.png -resize 512x512 $APPNAME.png

./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda -i $APPNAME.png -d $(readlink -f "$APPNAME.desktop") --custom-apprun AppRun --output appimage

results in

[conda/stdout]     running develop
[conda/stdout]     Checking .pth file support in "$APPDIR"/usr/conda//lib/python3.7/site-packages
[conda/stdout]     /home/me/AppDir/usr/conda/bin/python -E -c pass
[conda/stdout]     TEST FAILED: "$APPDIR"/usr/conda//lib/python3.7/site-packages does NOT support .pth files
[conda/stdout]     error: bad install directory or PYTHONPATH
[conda/stdout]     
[conda/stdout]     You are attempting to install a package to a directory that is not
[conda/stdout]     on PYTHONPATH and which Python does not read ".pth" files from.  The
[conda/stdout]     installation directory you specified (via --install-dir, --prefix, or
[conda/stdout]     the distutils default setting) was:
[conda/stdout]     
[conda/stdout]         "$APPDIR"/usr/conda//lib/python3.7/site-packages

Don't we set --prefix nowadays?

Still an issue?

I can confirm that this is no longer an issue. 👍