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

Do you know how to create an AppImage for a pip package? #149

Open
fusion809 opened this issue Nov 29, 2016 · 6 comments
Open

Do you know how to create an AppImage for a pip package? #149

fusion809 opened this issue Nov 29, 2016 · 6 comments
Labels

Comments

@fusion809
Copy link

Hi,

I'd like to know if you have any ideas as to how to create an AppImage for a python pip package. There are a few pip packages I am interested in turning into an AppImage, such as:

  • Blockify
  • Spyder
  • youtube-dl

Any ideas as to how to do this? I have tried running # pip install --install-option="--prefix=/AppDir/usr" --ignore-installed spyder from within a CentOS 7 Docker container but it installed Spyder in the /usr directory not in /AppDir.

Thanks for your time,
Brenton

@probonopd
Copy link
Member

Hi Brenton, please check out https://docs.python.org/3/library/venv.html

@fusion809
Copy link
Author

For some reason Spyder's pip install is failing in this virtual environment:

Downloading/unpacking spyder
  Running setup.py egg_info for package spyder
    WARNING: unable to build documentation because Sphinx is not installed
    
    warning: no files found matching '*.svg' under directory 'spyder_breakpoints'
    warning: no files found matching '*.png' under directory 'spyder_breakpoints'
    warning: no files found matching '*.svg' under directory 'spyder_profiler'
    warning: no files found matching '*.svg' under directory 'spyder_pylint'
    warning: no files found matching '*.' under directory 'doc'
    warning: no files found matching 'CHANGELOG'
Downloading/unpacking rope>=0.9.4 (from spyder)
  Running setup.py egg_info for package rope
    
Downloading/unpacking jedi (from spyder)
  Running setup.py egg_info for package jedi
    
    warning: no previously-included files matching '*.pyc' found under directory '*'
Downloading/unpacking pyflakes (from spyder)
  Running setup.py egg_info for package pyflakes
    
Downloading/unpacking pygments>=2.0 (from spyder)
  Running setup.py egg_info for package pygments
    
Downloading/unpacking qtconsole>=4.2.0 (from spyder)
  Running setup.py egg_info for package qtconsole
    
Downloading/unpacking nbconvert (from spyder)
  Running setup.py egg_info for package nbconvert
    
Downloading/unpacking sphinx (from spyder)
  Running setup.py egg_info for package sphinx
    
    warning: no files found matching 'TODO'
    warning: no files found matching 'ez_setup.py'
    no previously-included directories found matching 'doc/_build'
Downloading/unpacking pep8 (from spyder)
  Running setup.py egg_info for package pep8
    
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'testsuite'
    warning: no previously-included files matching '*.pyo' found under directory 'testsuite'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking pylint (from spyder)
  Running setup.py egg_info for package pylint
    
    warning: no files found matching 'README'
    warning: no files found matching 'README.Python3'
    warning: no files found matching '*.html' under directory 'doc'
Downloading/unpacking psutil (from spyder)
  Running setup.py egg_info for package psutil
    
    warning: no previously-included files matching '*' found under directory 'docs/_build'
Downloading/unpacking qtawesome (from spyder)
  Running setup.py egg_info for package qtawesome
    
Downloading/unpacking qtpy>=1.1.0 (from spyder)
  Downloading QtPy-1.1.2.tar.gz
  Running setup.py egg_info for package qtpy
    
Downloading/unpacking pickleshare (from spyder)
  Downloading pickleshare-0.7.4.tar.gz
  Running setup.py egg_info for package pickleshare
    
Downloading/unpacking pyzmq (from spyder)
  Running setup.py egg_info for package pyzmq
    
    warning: no files found matching 'tox.ini'
    no previously-included directories found matching 'docs/build'
    no previously-included directories found matching 'docs/gh-pages'
    warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
    warning: no previously-included files found matching 'bundled/zeromq/src/platform.hpp'
    warning: no previously-included files found matching 'setup.cfg'
    warning: no previously-included files found matching 'zmq/libzmq*'
    warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
    warning: no previously-included files matching '.deps/*' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    warning: no previously-included files matching '*.pyd' found anywhere in distribution
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '.DS_Store' found anywhere in distribution
    warning: no previously-included files matching '.mailmap' found anywhere in distribution
    warning: no previously-included files matching 'Makefile.am' found anywhere in distribution
    warning: no previously-included files matching 'Makefile.in' found anywhere in distribution
Downloading/unpacking traitlets (from qtconsole>=4.2.0->spyder)
  Running setup.py egg_info for package traitlets
    
Downloading/unpacking jupyter-core (from qtconsole>=4.2.0->spyder)
  Running setup.py egg_info for package jupyter-core
    
Downloading/unpacking jupyter-client>=4.1 (from qtconsole>=4.2.0->spyder)
  Running setup.py egg_info for package jupyter-client
    
Downloading/unpacking ipykernel>=4.1 (from qtconsole>=4.2.0->spyder)
  Running setup.py egg_info for package ipykernel
    
Downloading/unpacking mistune!=0.6 (from nbconvert->spyder)
  Running setup.py egg_info for package mistune
    
    warning: no previously-included files found matching 'mistune.c'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
Downloading/unpacking jinja2 (from nbconvert->spyder)
  Running setup.py egg_info for package jinja2
    
    warning: no files found matching 'run-tests.py'
    warning: no files found matching '*' under directory 'custom_fixers'
    warning: no files found matching '*' under directory 'jinja2/testsuite/res'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    warning: no previously-included files matching '*.pyc' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'jinja2'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
Downloading/unpacking nbformat (from nbconvert->spyder)
  Running setup.py egg_info for package nbformat
    
Downloading/unpacking entrypoints (from nbconvert->spyder)
  Could not find any downloads that satisfy the requirement entrypoints (from nbconvert->spyder)
Cleaning up...
No distributions at all found for entrypoints (from nbconvert->spyder)
Storing complete log in /root/.pip/pip.log

I have reported this issue upstream spyder-ide/spyder#3766.

@fusion809
Copy link
Author

Hmm, well I seem to have overcome that little error with the help of the Spyder dev team, but there is still one big one. Python seems to be very absolute path-oriented, so it seems like quite the challenge to provide a portable app. Like when I copy the AppDir from the CentOS 7 Docker container to my Ubuntu 16.04 system and run AppDir/usr/bin/spyder it gives the error:

zsh: ./spyder: bad interpreter: /AppDir/usr/bin/python: no such file or directory

The only solution StackOverflow has offered me is (here is a link) to replace the shebangs with relative paths but that has failed too. When I run AppDir/usr/bin/spyder after replacing shebangs it starts Python in the terminal, instead of launching Spyder. Do you have any ideas?

@probonopd
Copy link
Member

Use union: true or binpatch: true.

@fusion809
Copy link
Author

But this AppImage is built in a CentOS 7 Docker container, so I can't use a yaml for it, can I?

@probonopd
Copy link
Member

No, so you'd need to do manually what union: true or binpatch: true do. See the meta Recipe file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants