Code Monkey home page Code Monkey logo

Comments (8)

niess avatar niess commented on June 15, 2024

Hello,

yes, I would expect this do work. Actually, I could distribute the relocated Pythons as zip files as well. AppImage is relevant only when running live without extracting. But for Python runtimes I find it more convenient to extract the images because then you can also pip install to the extracted image etc.

A starting point could be to use the relocate function on an OSX Python install. There might be some specificities related to OSX requiring extra tweaks though?

Do you have access to an OSX to test? If not this project can be very helpful: macos-virtualbox.

In a second step, if it works, you could use GitHub CI with an OSX worker and relocate its Python install(s)

from python-appimage.

anki-code avatar anki-code commented on June 15, 2024

Got it! Yep, I have OSX in VB for tests. Thank you for details and links! I'll dive into it.

from python-appimage.

niess avatar niess commented on June 15, 2024

Hey @anki-code . I was just curious if you had any success on this? I could make use of it as well for OSX :) But maybe this was not so straightforward? As they say: "the devil is in the details".

from python-appimage.

anki-code avatar anki-code commented on June 15, 2024

First of all I tried on Arch with Miniconda and had a success:

mkdir /tmp/reloc
cd /tmp/reloc
sudo python -m python_appimage build local
# No such file or directory: /usr/share/tcl8.6
vim /opt/miniconda3/lib/python3.8/site-packages/python_appimage/appimage/relocate.py
# Replace /usr/share to /usr/lib
sudo python -m python_appimage build local
# [2021-05-03 19:38:00,995] CLONE    python3.8 from /opt/miniconda3
# [2021-05-03 19:38:12,748] PRUNE    python3.8 packages
# [2021-05-03 19:38:12,749] SYMLINK  python, python3 to python3.8
# [2021-05-03 19:38:12,749] SYMLINK  pip, pip3 to pip3.8
# [2021-05-03 19:38:12,749] HOOK     python3.8 site packages
# [2021-05-03 19:38:12,749] LINK     python3.8 C-extensions
# [2021-05-03 19:38:14,705] INSTALL  AppRun
# [2021-05-03 19:38:14,719] INSTALL  python3.8.5.desktop
# [2021-05-03 19:38:14,720] INSTALL  python.png
# [2021-05-03 19:38:14,720] INSTALL  python3.8.5.appdata.xml
# [2021-05-03 19:38:14,721] BUILD    AppDir
ls
# python3.8.5-x86_64.AppImage

Then I tried MacOS with Miniconda:

vim /Users/pc/miniconda3/lib/python3.8/site-packages/python_appimage/__init__.py
# Disable check
sudo python -m python_appimage build local
# [2021-05-03 09:42:16,608] CLONE    python3.8 from /Users/pc/miniconda3
# [2021-05-03 09:42:30,737] PRUNE    python3.8 packages
# [2021-05-03 09:42:30,745] SYMLINK  python, python3 to python3.8
# [2021-05-03 09:42:30,747] HOOK     python3.8 site packages
# [2021-05-03 09:42:30,750] LINK     python3.8 C-extensions
# [2021-05-03 09:42:30,751] INSTALL  patchelf from https://github.com/niess/patchelf.appimage/releases/download
# RuntimeError: /bin/sh: ./patchelf-x86_64.AppImage: cannot execute binary file

That's all for now :)

from python-appimage.

niess avatar niess commented on June 15, 2024

OK, I see. Patchelf needs a replacement on OSX. It is used to make binaries look for shared libs under a relative path (hence in the AppImage as well) instead of using an absolute one. So unfortunately more work is needed to make it relocatable on OSX.

from python-appimage.

anki-code avatar anki-code commented on June 15, 2024

I've found some builds of Python here - https://github.com/indygreg/python-build-standalone/releases/tag/20210415

from python-appimage.

niess avatar niess commented on June 15, 2024

Hey @anki-code . Interesting :) Does it work fine for xxh on OSX?

It looks like everything is built from scratch, isn'it?

Python-appimage instead relies on an existing install. It patches it in order to make it relocatable. In particular the manylinux installs are used, i.e. the same than for generating binary wheels which should ensure the same compatibility tags.

from python-appimage.

anki-code avatar anki-code commented on June 15, 2024

I tried to use libpython3.8.a from python-build-standalone for xonsh-portable-binary (dockerfile) but without success. I got strange error about wrong format. That's all for now.

from python-appimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.