linuxdeploy/linuxdeploy-plugin-conda

Activating Conda Environment

CPUFronz opened this issue · 2 comments

This one is similar to #25 and #12 but slightly different, I use the plugin to pack local files into a AppImage with Conda runtime:

  1. I download and install the packages I need
  2. I copy my Python files into AppDir/
  3. I create a start script
  4. I run ./linuxdeploy-x86_64.AppImage

Here is the script for creating the AppImage and here the start script. It is kind of hacky.

It actually works, but only as long as I don't delete AppDir/ (line 44). It uses the "build" environment for execution, as soon as it is gone, the application doesn't work.

I guess the problem is, that Conda uses a lot of hard-coded, absolute paths. Is there a way around this? Meaning being able to activate the Conda environment when launching the AppImage?

Right now the primary use case for the conda plugin is to ship Python software in an AppImage. It looks like you're trying to do the same. In that case, activating the environment is usually not necessary, as you can simply call the "right" Python, the path can be predicted (in your case $APPDIR/usr/conda/bin/python AFAICS).

Being able to activate the environment requires solving the two issues you mentioned in some good way (well, it all boils down to #12). If you have a solution for that, please post it. I haven't come up with a good one yet, unfortunately. Everything proposed so far is pretty much a hack.

I also thought that the "right" environment will be called from the get-go, but that wasn't the case.

Unfortunately I also don't have a solution for this. I tried to modify the shebang when creating the AppImage and while starting the AppImage: both were very dirty hacks and didn't work.