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

python backend with conda #12

Closed
d-vogel opened this issue Apr 13, 2023 · 3 comments
Closed

python backend with conda #12

d-vogel opened this issue Apr 13, 2023 · 3 comments

Comments

@d-vogel
Copy link

d-vogel commented Apr 13, 2023

Thanks David for taking the time to do what I had planned for a long time.

I solved the issue myself, but posting it for others.

The symptoms:

When installing the plamoid (and the python backend) on my system (openSuse TW) with conda, the plasmoid was not able to find the python module (the error in the plasmoid is "Unable to parse error message").

The problem:

This is because with conda installed, the python used by default is the python from your "base" environment. However in my case, because the base environment was python3.7 and ddcci_plasmoid_backend requires 3.10, pip installed it in the system python (in /usr/lib/python3.10/).

The solution

Update the conda "base" environement to 3.10 (conda update -n base python) and this time pip installs in the right location.

Discussion

This is not a super elegant solution anyways, as it doesn't make much sense to install the backend for a plasmoid in a user-specific conda env, so I'm kind of opening the discussion here:
how can we get the plasmoid to run using the system python (ie /usr/bin/python) so that we can just conda deactivate && pip install ddcci_plasmoid_backend or even better, have a rpm package containing the whole plasmoid ?

@davidhi7
Copy link
Owner

how can we get the plasmoid to run using the system python (ie /usr/bin/python) so that we can just conda deactivate && pip install ddcci_plasmoid_backend

Having no knowledge about how conda works and what it does I can't comment on that. As discussed in another issue, the 3.10 requirement is kind of arbitrary and I will try to lower it with some testing to make this widget compatible with more configurations. However, I have no idea how to deal with conda-specific issues.

have a rpm package containing the whole plasmoid

Native distro packages are really the best solution for packaging. I don't plan on providing such packages for distros except for archlinux, though I will gladly support others doing this.

@CatEricka
Copy link
Contributor

CatEricka commented Apr 14, 2023

Maybe you need #7, so any kind of backend can be used via a custom scripts.

For your conda environment, you can refer to https://docs.conda.io/projects/conda/en/latest/commands/run.html
use conda run -n <env name> <command> to invoke python commands in a specific environment. (Is there a performance issue with this? I'm not sure.)

ref: https://stackoverflow.com/questions/34534513/calling-conda-source-activate-from-bash-script

@davidhi7
Copy link
Owner

davidhi7 commented Apr 16, 2023

I looked into the required python version, now the backend supports python 3.8 but 3.7 would require more changes which I don't plan to implement for an almost five year old release. Also, the option to set a custom backend command is now merged, so one could run some conda-specific commands beforehand.

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

3 participants