Skip to content
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

ModuleNotFoundError when using linuxdeploy-plugin-conda #11

Closed
probonopd opened this issue Jan 2, 2019 · 3 comments
Closed

ModuleNotFoundError when using linuxdeploy-plugin-conda #11

probonopd opened this issue Jan 2, 2019 · 3 comments

Comments

@probonopd
Copy link
Contributor

Not sure if this is a linuxdeploy-plugin-conda bug or a bug in the TruFont Python packaging.

Here is my script:

#! /bin/bash

export APPNAME=trufont
export PIP_REQUIREMENTS="$APPNAME"
# export CONDA_PACKAGES="$APPNAME" # 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

touch "$APPNAME.svg"
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda -i $(readlink -f "$APPNAME.svg") -d $(readlink -f "$APPNAME.desktop") --output appimage

An AppImage gets generated, but it does not run:

me@host:~$ ./TruFont-x86_64.AppImage 
Traceback (most recent call last):
  File "/tmp/.mount_TruFonZMkCwr/AppRun", line 7, in <module>
    from trufont.__main__ import main
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/trufont/__main__.py", line 1, in <module>
    from defconQt import representationFactories as baseRepresentationFactories
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/defconQt/representationFactories/__init__.py", line 3, in <module>
    from defcon import Glyph, Image, registerRepresentationFactory
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/defcon/__init__.py", line 10, in <module>
    from defcon.objects.font import Font
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/defcon/objects/font.py", line 7, in <module>
    from fontTools.ufoLib import UFOReader, UFOWriter, UFOLibError, UFOFileStructure
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/fontTools/ufoLib/__init__.py", line 9, in <module>
    import fs
ModuleNotFoundError: No module named 'fs'
@probonopd
Copy link
Contributor Author

Maybe TruFont has an undocumented dependency on https://pypi.org/project/fs/?

@probonopd
Copy link
Contributor Author

Indeed, also installing fs from PyPI solves this. Now running into

me@host:~$ ./TruFont-x86_64.AppImage 
Traceback (most recent call last):
  File "/tmp/.mount_TruFontlFOjs/AppRun", line 7, in <module>
    from trufont.__main__ import main
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/trufont/__main__.py", line 4, in <module>
    from trufont.objects.application import Application
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/trufont/objects/application.py", line 13, in <module>
    from trufont.windows.inspectorWindow import InspectorWindow
  File "/home/me/AppDir/usr/conda/lib/python3.7/site-packages/trufont/windows/inspectorWindow.py", line 1, in <module>
    from defconQt.controls.accordionBox import AccordionBox
ModuleNotFoundError: No module named 'defconQt.controls.accordionBox'

@probonopd
Copy link
Contributor Author

probonopd commented Jan 2, 2019

Turned out both were unrelated to linuxdeploy-plugin-conda but maybe this verbose description helps others who might be running into similar issues. For the record, this works:

#! /bin/bash

sudo apt -y install git

export APPNAME=trufont
export PIP_REQUIREMENTS="-e git+https://github.com/trufont/trufont#egg=$APPNAME fs"
# export CONDA_PACKAGES="$APPNAME" # 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

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") --output appimage

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

No branches or pull requests

1 participant