Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Activating Conda Environment #32

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

Open
CPUFronz opened this issue Jan 20, 2020 · 2 comments · May be fixed by #41
Open

Activating Conda Environment #32

CPUFronz opened this issue Jan 20, 2020 · 2 comments · May be fixed by #41

Comments

@CPUFronz
Copy link

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?

@TheAssassin
Copy link
Member

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.

@CPUFronz
Copy link
Author

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.

knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
@knarfS knarfS linked a pull request Jun 11, 2021 that will close this issue
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 11, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 12, 2021
This removes some of the wrong paths pointing to the build location of the
AppImage by using a different shebang and some environment variables.

Fixes linuxdeploy#12, linuxdeploy#25 and linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 12, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 13, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
knarfS added a commit to knarfS/linuxdeploy-plugin-conda that referenced this issue Jun 25, 2021
This removes some of the wrong, absolute paths pointing to the build location
of the AppImage by using a different shebang and some environment variables,
set by the linuxdeploy-plugin-conda-hook at the AppImage start.

Fixes linuxdeploy#12, fixes linuxdeploy#25 and fixes linuxdeploy#32
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

Successfully merging a pull request may close this issue.

2 participants